HTTP Status Codes

A List of all HTTP status codes and messages

HTTP Status Codes

1. Errors do occur during a communication between a Client and Server.

2. The nature of HTTP(Hypertext Transfer Protocol) is error denoted by HTTP status codes.

3. HTTP status codes are of three digits(Eg: 1xx, 2xx, 3xx...), the first digits of the status code specifies the class of status response.

4. There are in all five class of responses.

Informational, Success, Redirection, Client Error, Server Error

1xx: Informational Responses.

Denotes a provisional response from the server to client

Status Code Status Message Description
100 Continue An interim response to denote so far its all OK,client can continue with request or ingnore if already finished.
101 Switching Protocols Request was sent to switch protocols and the server has acknowledged.
103 Checkpoint To allow resumption of PUT or POST request which were earlier aborted

2xx: Success Responses.

Denotes that the client's request was recieved, realised , accepted and eventually processed successfully.

Status Code Status Message Description
200 OK Request Successful.The meaning varies for each HTTP method

GET: Resource has been recieved and is being sent in the message.

HEAD: The entity headers is being sent in the message body.

POST: The result of action performed is being sent in the message body.

TRACE: The request message is sent within the message body as recieved by the server.

201 Created The resource was created(for requests that create server objects)
202 Accepted The request was accepted, but the server has not yet performed any action with it
203 Non-Authoritative Information The transaction was okay, except the information contained in the entity headers was not from the origin server, but from a copy of the resource
204 No Content The response message contains headers and a status line,but no entity body.
205 Reset Content Another code primarily for browsers, basically means that the browser should clear any HTML form elements on the current page.
206 Partial Content The partial request was sucessfull.

3xx: Redirection Responses.

Denotes the additional action client needs to perform to complete the request.

Status Code Status Message Description
300 Multiple Choices A client has requested a URL that actually refers to multiple resources. This code is returned along with a list of options, the user can then select which one is required.
301 Moved Permanently The requested URL has been moved. The response should contain a Location URL indicating where the resource now resides.
302 Found Similar to 301 status code, but the move is temporary. The client should use the URL given in the location header to locate the resource temporarily.
303 See Other Tells the client that the resource should be fetched using a different URL. This new URL is in the location header of the resource has not changed.
304 Not Modified Client can make their requests conditional by the request headers they include. This code indicate that the resource has not changed.
305 Use Proxy The resource must be accessed through a proxy, the location of the proxy is given in the Location header.
306 Switch Proxy Status code is currently not used.
307 Temporary Redirect Similar to 301 status code, however, the client should use the URL given in the Location header to locate the resource temporarily.
308 Resume Incomplete Resume uncompleted requests.

4xx: Client Error Responses.

Denotes the cases of error the client may encounter

Status Code Status Message Description
400 Bad Request Tells the client it sent a malformed request.
401 Unauthorized Returned along with appopriate header that ask the client to authenticate itself before it can gain access to the resource.
402 Payment Required Currently this status code is not used, but it has been set aside for future use.
403 Forbidden The request was refused by the server.
404 Not Found The server cannot find the requested URL
405 Method Not Allowed A request wasmade with a method that is not supported for the requested URL.The Allow header should be included in the response to tell the client what methods are allowed on the requested resource.
406 Not Acceptable Clients can specify parameters about what types of entities they are willing to accept. This code is used when the server has no resource matching the URL that is acceptable for the client.
407 Proxy Authentication Required Like the 401 status code, but used for proxy servers that require authentication for a resource.
408 Request Timeout If a client too long to complete its request, a server can send back this status code and close down the connection.
409 Conflict The request is causing some conflict on a resource.
410 Gone Similar to 404 status code, except that the server once held the resource.
411 Length Required Server use this code when they require a Content-Length header in the request message.The server will not accept requests for the resource without the Content-Length header.
412 Precondition Failed If a client makes a conditional request and one of the conditions fails, this response code is returned.
413 Request Entity Too Large The client sent an entity body that is larger than the server can or want to process.
414 Request URI too long The client sent a request with a request URL that is larger that what the server can or wants to process.
415 Unsupported Media Type The client sent an entity of a content type that the server does not understand or support.
416 Requested Range Not Satisfiable The request message requested a range of a given resoure, and that range either was invalid or could not be met.
417 Expectation Failed The request contained an expection in the Expect request header that could not be satisfied by the server.

5xx: Server Error Responses.

Denotes failure on server's end to complete a client request.

Status Code Status Message Description
500 Internal Server Error The server encountered an error that prevented it from servicing the request.
501 Not Implemented The client made a request that is beyond the server's capabilities.
502 Bad Gateway A server acting as a proxy or gateway encountered a bogus reponse from the next link in the request reponse chain.
503 Service Unavailable The server cannot currently service the request but will be able to in the future.
504 Gateway Timeout Just like 408 status code, expect that the response is comming from a geteway or proxy that has timed out waiting for a reponse to its requests from another server.
505 HTTP Version Not Supported The server received a request in a version of the protocol that it can't or won't support.
511 Network Authentication Required Authentication required for the client to gain network access.

Related Examples

Related Tags