HTTP Status Codes Cheat Sheet: An Exhaustive List

Click here to load reader

  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of HTTP Status Codes Cheat Sheet: An Exhaustive List


2. 1xx InformationalSTATUS CODESCONTINUESWITCHING PROTOCOLSPROCESSINGCODE MEANINGThe server has received the request headers, andthe client should proceed to send the request body.To have a server check if the request could be acceptedbased on the request's headers alone, a client must sendExpect: 100-continue as a header in its initial request andcheck if a 100 Continue status code is received in responsebefore continuing.The requester has asked the server to switch protocolsand the server is acknowledging that it will do so.As a WebDav request may contain many sub-requestsinvolving file operations, this request could take some time.This code indicates that the server has received and isprocessing, but a response is not yet available.100101102 3. 2xx SuccessSTATUS CODES CODE MEANINGStandard response for successful HTTP requests.The actual response will depend on the request method.A GET request will have response that contains an entitycorresponding to the requested resource. A POST requestwill contain an entity describing the result of the action.The request has been fulfilled and resulted in a newresource being created.The request has been accepted for processing, but theprocessing has not been completed. The request mightor might not eventually be acted upon, as it might bedisallowed when processing actually takes place.OKCREATEDACCEPTED200201202 4. STATUS CODES CODE MEANINGThe server successfully processed the request, but isreturning information that may be from another source.The server successfully processed the request, but is notreturning any content. (Usually response to delete request.)The server successfully processed the request, but is notreturning any content. This response requires that therequester reset the document view.The server is delivering only part of the resource dueto a range header sent by the client. The range headeris used by tools like wget to enable resuming ofinterrupted downloads, or split a download into multiplesimultaneous streams.NON-AUTHORITATIVEINFORMATION203204 NO CONTENT205 RESET CONTENT206 PARTIAL CONTENT2xx Success 5. STATUS CODES CODE MEANINGThe message body that follows is an XML message andcan contain a number of separate response codes,depending on how many sub-requests were made.The members of a DAV binding have already beenenumerated in a previous reply to this request, and arenot being included again.The server has fulfilled a GET request for the resource,and the response is a representation of the result ofone or more instance-manipulations applied to thecurrent instance.207 MULTIPLE STATUS208 ALREADY REPORTED226 IM USED2xx Success 6. 3xx RedirectionSTATUS CODES CODE MEANINGIndicates multiple options for the resource that theclient may follow. For instance, it could be used topresent different format options for video, list fileswith different extensions, or word sense disambiguation.This and all future requests should be directed to thegiven URI.300 MULTIPLE CHOICES301 MOVED PERMANENTLYAn industry practice contradicting the standard; TheHTTP/1.0 specification required the client to performa temporary redirect, but popular browsers implemented302 with the functionality of a 303.Status codes 303 and 307 distinguish between the twobehaviors; however, some frameworks use 302 (asif the code were a 303).302FOUND 7. 3xx RedirectionSTATUS CODES CODE MEANINGThe response to the request can be found underanother URI using a GET method. When received inresponse to a POST, it should be assumed that theserver has received the data and the redirect shouldbe issued with a separate GET message.303 SEE OTHERIndicates that the resource has not been modifiedsince the version specified by the request headers.There is no need to retransmit the resource, since theclient still has a previously-downloaded copy.304 NOT MODIFIEDThe requested source is only available through a proxy,whose address is provided in the response. Many HTTPclients do not correctly handle responses with thisstatus code, primarily for security reasons.305 USE PROXY 8. 3xx RedirectionSTATUS CODES CODE MEANINGNo longer used. Originally meant subsequentrequests should be the specified proxy.306 SWITCH PROXYThe request should be repeated with another URI;however, future requests should still use the originalURI. This method is not allowed to be changed whenreissuing the original request.For instance, a POST request should be repeated usinganother POST request.307 TEMPORARY REDIRECTThe request, and all future requests should be repeatedusing another URI. 307 and 308 parallel the behaviors of302 and 301, but do not allow the HTTP method to change.308 PERMANENT REDIRECT 9. 4xx Client ErrorSTATUS CODES CODE MEANING400 BAD REQUEST The request cannot be fulfilled due to bad syntax.Similar to 403 Forbidden, but used specifically for whenauthentication is required and has not failed or has notyet been provided.The response must include a WWW-Authenticate headerfield containing a challenge applicable to therequested resource.401 UNAUTHORIZEDReserved for future use. The original intention was thatthis code might be used as part of some form of digitalcash or micropayment scheme, but that has not happened,and this code is not usually used.402 PAYMENT REQUIRED 10. 4xx Client ErrorSTATUS CODES CODE MEANINGThe request was a valid request, but the server isrefusing to respond to it. Unlike a 401 Unauthorizedresponse, authenticating will make no difference.403 FORBIDDENThe requested source could not be found but may beavailable again in the future. Subsequent requests bythe client are permissible.404 NOT FOUNDA request was made of a resource using a requestmethod not supposed by that resource.For example, using GET on a form which requiresdata to be presented via POST, or using PUT on aread-only resource.405 METHOD NOT ALLOWEDThe requested resource is only capable of generatingcontent not acceptable according to the Accept headerssent in the request.406NOT ACCEPTABLE 11. 4xx Client ErrorSTATUS CODES CODE MEANINGPROXY AUTHENTICATION The client must first authenticate itself with the proxy.REQUIRED407The server timed out waiting for the request. The clientdid not make a request within the time that the serverwas prepared to wait. At a later time, the request maybe repeated without modifications.408 REQUEST TIMEOUTIndicates that the request could not be processedbecause of conflict in the request.409 CONFLICTIndicates that the resource requested is no longeravailable and will not be available again.This should be used when a resource has beenintentionally removed. Upon receiving this code, theclient should not request the resource again.410 GONE 12. 4xx Client ErrorSTATUS CODES CODE MEANINGThe request did not specify the length of its content,which is required by the requested resource.411 LENGTH REQUIREDThe server does not meet one of the preconditionsthat the requester put on the request.412 PRECONDITION FAILEDThe request is larger than the server is willing orable to process.REQUEST ENTITYTOO LARGE413The URI provided was too long for the server toprocess. Often the result of too much data beingencoded as a query-string of a GET request.414 REQUEST-URI TOO LONGThe request entity has a media type which the serveror resource does not support. For example, theclient uploads an image as image/svg+xml, but theserver requires that images use a different format.UNSUPPORTEDMEDIA TYPE415 13. 4xx Client ErrorSTATUS CODES CODE MEANINGThe client has asked for a portion of the file, but theserver cannot supply that portion.For example, if the client asked for a part of the filethat lies beyond the end of the file.REQUESTED RANGENOT SATISFIABLE416The server cannot meet the requirements of theExpect request-header field.417 EXPECTATION FAILEDThis code was defined in 1998 as one of thetraditional IETF April Fools jokes, and is not expectedto be implemented by actual HTTP servers.418 IM A TEAPOTNot a part of the HTTP standard, this code denotesthat previously valid authentication has expired. It isused as an alternative to 401 Unauthorized in orderto differentiate from otherwise authenticated clientsbeing denied access to specific server resources.AUTHENTICATIONTIMEOUT419 14. 4xx Client ErrorSTATUS CODES CODE MEANINGNot part of the HTTP standard, but defined by Springin the HttpStatus class to be used when a methodfailed. This status code is deprecated by Spring.420 METHOD FAILURENot part of the HTTP standard, but returned byversion 1 of the Twitter Search and Trends API whenthe client is being rate limited. Other services maywish to implement the 429 Too Many Requests code.421 ENHANCE YOUR CALMThe request was well-formed but was unable to befollowed due to semantic errors.422 UNPROCESSABLE ENTITY423 LOCKED The resource that is being accessed is locked.424 FAILED DEPENDENCY The request failed due to failure of a previous request.The client should switch to a different protocolsuch as TLS/1.0.426 UPGRADE REQUIRED 15. 4xx Client ErrorSTATUS CODES CODE MEANINGThe origin server requires the request to beconditional. Intended to prevent the lost updateproblem; where a client GETs a resources state,modifies it, and PUTs it back to the server, while athird party has modified the state on their server,leading to a conflict.PRECONDITIONREQUIRED428The user has sent too many requests in a given amountof time. Intended for use with rate limiting schemes.429 TOO MANY REQUESTSThe server is unwilling to process the request becauseeither an individual header field, or all the headerfields collectively, are too large.REQUEST HEADERFIELDS TOO LARGE431A Microsoft extension. Indicates that your sessionhas expired.440 LOGIN TIMEOUTUsed in Nginx logs to indicate that the server hasreturned no information to the client and closed theconnection (useful as a deterrent for malware).444 NO RESPONSE 16. 4xx Client ErrorSTATUS CODES CODE MEANINGA Microsoft ext