http-status-codes

What is the exact response structure for HTTP status code 300 (Multiple Choices)?

 ̄綄美尐妖づ 提交于 2019-12-23 07:24:48
问题 When a user clicks a link to a drawing on my site http://mysite.com/some-drawing , I would like my server to respond with status code 300 and two resource locations: http://mysite.com/some-drawing.png and http://mysite.com/some-drawing.myapp , and have the client browser decide automatically which one to use, based on its capabilities: If MyApp is installed on the user's machine, then the browser should download the *.myapp version and use MyApp to display it. However, if MyApp is not

What is the exact response structure for HTTP status code 300 (Multiple Choices)?

♀尐吖头ヾ 提交于 2019-12-23 07:24:17
问题 When a user clicks a link to a drawing on my site http://mysite.com/some-drawing , I would like my server to respond with status code 300 and two resource locations: http://mysite.com/some-drawing.png and http://mysite.com/some-drawing.myapp , and have the client browser decide automatically which one to use, based on its capabilities: If MyApp is installed on the user's machine, then the browser should download the *.myapp version and use MyApp to display it. However, if MyApp is not

What is the Correct HTTP Status Code for a Cancelled Request

前提是你 提交于 2019-12-23 06:50:32
问题 When a TCP connection gets cancelled by the client while making a HTTP request, I'd like to stop doing any work on the server and return an empty response. What HTTP status code should such a response return? 回答1: To be consistent I would suggest 400 Bad Request now if your backend apps are capable of identifying when the client gets disconnected or if you reject or close the connection, probably you could return Nginx' non-standard code 499 or 444. 499 Client Closed Request Used when the

Why my httpwebrequest post to myhandler.ashx is rejected with status code 401

前提是你 提交于 2019-12-23 02:38:28
问题 I've already written an HTTPHandler that gets POSTed from a ColdFusion page and it works successfully; now, I am trying to write a web application in ASP.NET so I can post a form to the .ashx handler from an .aspx page. Application Trace (trace.axd) shows the following as my last 3 entries: 2 8/14/2009 1:53:56 PM /Default.aspx 200 GET View Details 3 8/14/2009 1:54:04 PM /Default.aspx 200 POST View Details 4 8/14/2009 1:54:13 PM /UploadHandler.ashx 401 POST View Details I have a breakpoint in

Return HTTP status code dynamically as per the request using @ExceptionHandler

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 09:13:22
问题 I want to return HTTPStatus code dynamically like 400, 400, 404 etc as per the response object error. I was referred to this question - Programmatically change http response status using spring 3 restful but it did not help. I have this Controller class with an @ExceptionHandler method @ExceptionHandler(CustomException.class) @ResponseBody public ResponseEntity<?> handleException(CustomException e) { return new ResponseEntity<MyErrorResponse>( new MyErrorResponse(e.getCode(), ExceptionUtility

Avoiding 304 (not modified) responses

旧街凉风 提交于 2019-12-22 03:27:12
问题 Is it an ExpiresDefault Apache directive enough to avoid HTTP Status 304 responses from the server? I have set ExpiresDefault "access plus 10 years" but I'm still seeing log entries with a 304 response for "GET /assets/template/default/css/style.min.css?v=1 HTTP/1.1" whenever I open any page on a local PHPMyFAQ site. Emptying the browser cache doesn't seem to change anything. 回答1: The Expires: header your server sends out has nothing to do with future 304 responses. It provides only an

How to access HTTP StatusDescription in custom error page

岁酱吖の 提交于 2019-12-21 21:29:30
问题 When an action (asp.net mvc 5) cannot find something in the database, the user must see a page with a short custom error message e.g. "Invoice 5 does not exist" . Also, the response must have a 404 HTTP code. Another example: when the action is improperly called, the user must see e.g. "Parameter 'invoiceId' is required" . Also, the response must have a 400 HTTP code. I tried to store the custom messages in the HTTP status description and to display them in custom error pages. There are two

HTTP status for “email not verified”

♀尐吖头ヾ 提交于 2019-12-21 07:14:22
问题 I have seen the list of all HTTP status codes. However to me it looks like there is no code for "email not verified" (used for authentication/authorization). Did you ever had the same "problem"? What HTTP status code did you use? I guess it should be a code starting with a 4 as it's a "client error". 回答1: The 4xx class of status code is intended for situations in which the client seems to have erred: 6.5. Client Error 4xx The 4xx (Client Error) class of status code indicates that the client

Are there languages/software that implements http status code 418?

纵然是瞬间 提交于 2019-12-20 16:24:20
问题 I know that status code 418 was defined as a April Fools' joke, and "is not expected to be implemented by actual HTTP servers" as is stated on Wikipedia. But I would be interested if any of you knew of a language/webserver/IDE that supports it. I was trying on Apache (via php), and obviously it got me an internal error (500). I just like the humor behind it (am not trying to troll here) and would like to know if more than just Emacs implements this. More precisely: It could be emulated in php

Correct HTTP status code for login form?

风格不统一 提交于 2019-12-20 09:48:59
问题 I am implementing the authentication for an app, and I am using a pluggable system with "authentication methods". This allows me to implement both HTTP Basic as well as HTML-based authentication. With HTTP Basic/Digest auth the server sends a 401 Unauthorized response header. However, according to the HTTP/1.1 RFC: The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource. Since I do not know of any "html" WWW