Friday, April 6, 2007

HTTP 1.1 Response Status Codes

Intro
For each request a client sends to the server, the web server returns a 3 digit HTTP status code indicating the server's response. Eg:

HTTP/1.1 404 Not Found

Here is the list of codes that the server sends and a brief description of the code.

The status response codes are grouped as :

100 - 199 : Informational Status Codes

Provides information to the Client that the server is starting to fulfill the request.


  • 100 Continue : Server says "Ready to receive the rest of the request"

  • 101 Switching Protocols : "Ready to switch the protocol specified by the client, in an Upgrade Request"



200 - 299 : Client Request Successful

Status codes that indicates the client's request was successfully accepted.

  • 200 OK : Successfully processed request and response is attached

  • 201 Created : Created the new URI specified by the Location Header.

  • 202 Accepted : Accepted for processing

  • 203 Non Authoritative Info : Indicates the META information originated from another server.

  • 204 No Content : Request complete, but no new information.

  • 205 Reset Content : Client should reset the current document.

  • 206 Partial Content : Used for GET requests for getting a part of the document. The server sends a Content-Range header to indicate the Data-Segment.



300 - 399 : Request Redirected


  • 300 Multiple Choices : Requested resource contains multiple documents

  • 301 Moved Permanently : The requested document has been moved from the current location, a new location is send in the Location Header

  • 302 Moved Temporarily : Requested document has been temporarily moved to location specified by the location header.

  • 303 See Other : The requested resource is found in a different location indicated by the Location Header.

  • 304 Not Modified : Server uses this code in response to the If Modified Since Request. This indicates the document has not been modified.
  • 305 Use Proxy : Client should use a proxy specified by the location header.

  • 307 Temporary Redirect : Requested resource is temporarily redirected to a different location specified by the Location Header.



400 - 499 : Client Request Incomplete

Indicates the client request is incomplete and needs more information to complete the request.


  • 400 Bad Request : Syntax error in the client request

  • 401 Unauthorized : Request requires authentication, server sends a WWW-Authenticate Header to indicate the authentication type.

  • 402 Payment Required : Reserved for Future

  • 403 Forbidden : Access to request is forbidden

  • 404 Not Found : Requested document is not found.(My Favorite)

  • 405 Method Not Allowed : Requested method is not acceptable

  • 406 Not Acceptable : Requested resource is not available in a format the client cannot accept.

  • 407 Proxy Authentication Required : Unauthorized access request to a proxy server. Server sends a Proxy Authenticate header.
  • 408 Request Time Out : The request timed out, client can reissue the request

  • 409 Conflict : The client requests conflict with each other.

  • 410 Gone : The requested resource has permanently been gone from the server

  • 411 Length Required : Content-Length must be required

  • 412 Precondition Failed : This is in response to one or more IF ... Headers send by the client, indicating one or more conditions specified is FALSE.

  • 413 Request Entity too large : The request body is too large, server refuses to process it

  • 414 Request-URI too Long : The server refuses to process the request because the URI is too large.

  • 415 Unsupported Media Type : Content body is unsupported by the server.

  • 416 Requested Range Not Satisfiable : Request range out of bounds.

  • 417 Expectation Failed : Server failed to meet the requirements of the Expect Header Request.


500 - 599 : Server Errors

Returned when the server encounters errors.


  • 500 Internal Server Error : Server config. setting or an external program has caused an error

  • 501 Not Implemented : Server does not have the functionality to fulfill request

  • 502 Bad Gateway : The Server encountered an invalid response from an upstream server or proxy

  • 503 Service Unavailable : Service is temporarily unavailable.

  • 504 Gateway Time-Out : Gateway / Proxy timed out

  • 505 HTTP Version Not Supported : HTTP version used by the client is not supported



Rest of the codes are reserved for Future

0 comments: