Http Error Code 200
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 http response example headers for this class of status code. Since HTTP/1.0 did not define any 1xx
Http Status Codes Cheat Sheet
status codes, servers MUST NOT send a 1xx response to an HTTP/1.0 client except under experimental conditions. A client MUST
Http Error Wordpress
be prepared to 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
Http Code 302
by a user agent. 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 http code 403 request. This interim response is used 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, a
sections of messages Error, Forward and redirection responses may be used to contain human-readable diagnostic information. Success 2xx These codes indicate success. The body section if present is the object returned by the request. It is a MIME format object. It http 422 is in MIME format, and may only be in text/plain, text/html or one fo the http 404 formats specified as acceptable in the request. OK 200 The request was fulfilled. CREATED 201 Following a POST command, this indicates success, but the http 502 textual part of the response line indicates the URI by which the newly created document should be known. Accepted 202 The request has been accepted for processing, but the processing has not been completed. The request may or may not https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html eventually be acted upon, as it may be disallowed when processing actually takes place. there is no facility for status returns from asynchronous operations such as this. Partial Information 203 When received in the response to a GET command, this indicates that the returned metainformation is not a definitive set of the object from a server with a copy of the object, but is from a private overlaid web. This may include annotation information about the object, for example. No https://www.w3.org/Protocols/HTTP/HTRESP.html Response 204 Server has received the request but there is no information to send back, and the client should stay in the same document view. This is mainly to allow input for scripts without changing the document at the same time. Error 4xx, 5xx The 4xx codes are intended for cases in which the client seems to have erred, and the 5xx codes for the cases in which the server is aware that the server has erred. It is impossible to distinguish these cases in general, so the difference is only informational. The body section may contain a document describing the error in human readable form. The document is in MIME format, and may only be in text/plain, text/html or one for the formats specified as acceptable in the request. Bad request 400 The request had bad syntax or was inherently impossible to be satisfied. Unauthorized 401 The parameter to this message gives a specification of authorization schemes which are acceptable. The client should retry the request with a suitable Authorization header. PaymentRequired 402 The parameter to this message gives a specification of charging schemes acceptable. The client may retry the request with a suitable ChargeTo header. Forbidden 403 The request is for something forbidden. Authorization will not help. Not found 404 The server has not found anything matching the URI given Internal Error 500 The server encountered an unexpected condition which prevented it from fulfilling
consisting only of the Status-Line and optional headers, and is terminated by an empty line. There http://www.restapitutorial.com/httpstatuscodes.html are no required headers for this class of status code. Since http://stackoverflow.com/questions/27921537/returning-http-200-ok-with-error-within-response-body HTTP/1.0 did not define any 1xx status codes, servers MUST NOT send a 1xx response to an HTTP/1.0 client except under experimental conditions. A client MUST be prepared to accept one or more 1xx status responses prior to a regular response, even if the client http error does not expect a 100 (Continue) status message. Unexpected 1xx status responses MAY be ignored by a user agent. 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: http error code 100-continue" field when it forwards a request, then it need not forward the corresponding 100 (Continue) response(s).) Wikipedia Request received, continuing process. 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. Since HTTP/1.0 did not define any 1xx status codes, servers must not send a 1xx response to an HTTP/1.0 client except under experimental conditions. 100 Continue The client SHOULD continue with its request. This interim response is used 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. Wikipedia This means that the server has received the
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 more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community 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 Returning http 200 OK with error within response body up vote 3 down vote favorite 3 I'm wondering if it is correct to return HTTP 200 OK when error on server side occurred with some error inside of response body. Example: We're sending http GET Something unexpected happened on the server side. Server returns http 200 OK status code with error inside a response (e.g. {"status":"some error occured"} Is is correct behavior or not? Shouldn't we change status code? http http-status-code-400 http-status-code-200 share|improve this question edited Jan 14 '15 at 10:01 CodeCaster 76.9k983136 asked Jan 13 '15 at 11:53 krzakov 3053923 1 HTTP 200 means transmission is OK on the http level. This has nothing to do with success or failure of your "business code". In this case the HTTP 200 indicates that your "business code error message" was succesfully transferred ;-) Alternatively you could let your server respond with HTTP 500 meaning "internal error". This is more typical for technical or unrecoverable problems on the server. –geert3 Jan 13 '15 at 11:57 Can anybody confirm that? I talked with some programmers and I can hear different opinions. –krzakov Jan 13 '15 at 12:01 add a comment| 3 Answers 3 active oldest votes up vote 10 down vote No, this is very incorrect. HTTP is an application protocol. 200 implies that the response contains a payload that represents the status of the requested resource. An error message usually is not a representation of that resource. If something goes wrong while processing GET, the right status code is 4xx ("you messed up") or 5xx ("I messed up"). share|improve this answer answered Jan 13 '15 at 13:05 Julian Reschke 19.9k43853 So basically You agree with previous answer? –krzakov Jan 13 '15 at 14:44 1 No, I disagree completely with the first part that claims that it would be ok to return 200. –Julian Reschke Jan 13 '15 at 15:02 I'm totally confused. Two completely different explanations. –krzakov Jan 14 '15 at 8:28 Please see my comment on the other answer. –geert3 Jan 14 '15 at 8:48 What I think 200 OK error can be appropriate on some cases. But in