Http Error Header
Contents |
response. 10.1 Informational 1xx This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. There are no required headers for http response example this class of status code. Since HTTP/1.0 did not define any 1xx status codes,
Http 418
servers MUST NOT send a 1xx response to an HTTP/1.0 client except under experimental conditions. A client MUST be prepared to http status codes cheat sheet accept one or more 1xx status responses prior to a regular response, even if the client does not expect a 100 (Continue) status message. Unexpected 1xx status responses MAY be ignored by a user agent. http code 403 Proxies MUST forward 1xx responses, unless the connection between the proxy and its client has been closed, or unless the proxy itself requested the generation of the 1xx response. (For example, if a proxy adds a "Expect: 100-continue" field when it forwards a request, then it need not forward the corresponding 100 (Continue) response(s).) 10.1.1 100 Continue The client SHOULD continue with its request. This interim response is used
Http Code 302
to inform the client that the initial part of the request has been received and has not yet been rejected by the server. The client SHOULD continue by sending the remainder of the request or, if the request has already been completed, ignore this response. The server MUST send a final response after the request has been completed. See section 8.2.3 for detailed discussion of the use and handling of this status code. 10.1.2 101 Switching Protocols The server understands and is willing to comply with the client's request, via the Upgrade message header field (section 14.42), for a change in the application protocol being used on this connection. The server will switch protocols to those defined by the response's Upgrade header field immediately after the empty line which terminates the 101 response. The protocol SHOULD be switched only when it is advantageous to do so. For example, switching to a newer version of HTTP is advantageous over older versions, and switching to a real-time, synchronous protocol might be advantageous when delivering resources that use such features. 10.2 Successful 2xx This class of status code indicates that the client's request was successfully received, understood, and accepted. 10.2.1 200 OK The request has succeeded. The information returned w
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn http 422 more about Stack Overflow the company Business Learn more about hiring developers or http 404 posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community
Http 502
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Rest error message in HTTP Header or Response Body? https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html up vote 36 down vote favorite 5 I have a REST service that is exposed to iPhone and Android clients. Currently I follow the HTTP codes 200, 400, 401, 403, 404, 409, 500 etc. My question is where is the recommended place to put the reason/description/cause of the error? Does it make more sense for the REST API to always have custom Reason in the header like so? http://stackoverflow.com/questions/13963932/rest-error-message-in-http-header-or-response-body < HTTP/1.1 400 Bad Request - Missing Required Parameters. < Date: Thu, 20 Dec 2012 01:09:06 GMT < Server: Apache/2.2.22 (Ubuntu) < Connection: close < Transfer-Encoding: chunked Or is it better to have it in the Response Body via JSON? < HTTP/1.1 400 Bad Request < Date: Thu, 20 Dec 2012 01:09:06 GMT < Server: Apache/2.2.22 (Ubuntu) < Connection: close < Transfer-Encoding: chunked < Content-Type: application/json { "error" : "Missing Required Parameters" } http rest http-error share|improve this question edited Apr 27 '13 at 9:11 Jonik 37.5k42179242 asked Dec 20 '12 at 1:27 James Cowhen 87911228 add a comment| 2 Answers 2 active oldest votes up vote 45 down vote accepted Quoting from the HTTP specification for 400.x error codes: The 4xx class of status code is intended for cases in which the client seems to have erred. Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. These status codes are applicable to any request method. User agents SHOULD display any included entity to the user. It is best practice to include the error message as an entity in the HTTP respons
& Guides Learn the Web Tutorials References Developer Guides Accessibility Game development ...more docs Mozilla Docs Add-ons Firefox WebExtensions Developer ToolsFeedback Get Firefox help Get https://developer.mozilla.org/en-US/docs/Web/HTTP/Status web development help Join the MDN community Report a content problem Report a bug Search Search Languages 日本語 (ja) 한국어 (ko) Русский (ru) 中文 (简体) (zh-CN) 正體中文 (繁體) (zh-TW) Add a translation Edit Advanced Advanced History Print this article MDN Web technology For developers HTTP HTTP response status codes Your Search Results fscholz sivasain arulnithi rctgamer3 groovecoder dovgart Sheppy fusionchess HTTP http code response status codes In This Article Information responsesSuccessful responsesRedirection messagesClient error responsesServer error responses HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes: informational responses, successful responses, redirects, client errors, and servers errors. Information responses 100 Continue This interim response indicates that everything so far is OK and that the client should http error header continue with the request or ignore it if it is already finished. 101 Switching Protocol This code is sent in response to an Upgrade: request header by the client, and indicates that the protocol the server is switching too. It was introduced to allow migration to an incompatible protocol version, and is not in common use. Successful responses 200 OK The request has succeeded. The meaning of a success varies depending on the HTTP method: GET: The resource has been fetched and is transmitted in the message body. HEAD: The entity headers are in the message body. POST: The resource describing the result of the action is transmitted in the message body. TRACE: The message body contains the request message as received by the server 201 Created The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request. 202 Accepted The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processin