The Meaning of HTTP Status Codes

The exams are over, the holiday has begun, time to start posting again — let’s write about HTTP status first.

What Is an HTTP Status Code

An HTTP status code (HTTP Status Code) is a 3-digit code used to indicate the HTTP response status of a web server; it shows how the server handled the HTTP request.

The Five Major Classes of HTTP Status Codes

100-199: Used to specify certain actions the client should take. 200-299: Used to indicate the request succeeded. 300-399: Used for files that have moved, often included in the Location header to specify the new address. 400-499: Used to point out client errors. 500-599: Used to support server errors.

HTTP Status Code List

HTTP Status Code List

StatusEnglish NameDescription
100ContinueContinue. The client should continue with its request.
101Switching ProtocolsSwitching protocols. The server switches protocols according to the client’s request. It can only switch to more advanced protocols, e.g., a newer version of HTTP.
200OKSuccess. Generally used for GET and POST requests.
201CreatedCreated. The request succeeded and a new resource was created.
202AcceptedAccepted. The request has been accepted but not yet processed.
203Non-Authoritative InformationNon-authoritative information. The request succeeded, but the returned meta information is not from the original server but a copy.
204No ContentNo content. The server processed successfully but returned no content. This ensures the browser keeps displaying the current document without updating the page.
205Reset ContentReset content. The server processed successfully; the user agent (e.g., browser) should reset the document view. This return code can be used to clear the browser’s form fields.
206Partial ContentPartial content. The server successfully processed part of the GET request.
300Multiple ChoicesMultiple choices. The requested resource may include multiple locations; a list of resource characteristics and addresses may be returned for the user agent (e.g., browser) to choose.
301Moved PermanentlyMoved permanently. The requested resource has been permanently moved to a new URI; the response includes the new URI, and the browser will automatically redirect to it. Any future new request should use the new URI instead.
302FoundTemporary move. Similar to 301, but the resource is only moved temporarily. The client should keep using the original URI.
303See OtherSee other. Similar to 301. Use GET and POST requests to view.
304Not ModifiedNot modified. The requested resource was not modified. When the server returns this status code, it returns no resource. Clients usually cache visited resources, and by providing a header indicating the client only wants resources modified after a given date.
305Use ProxyUse proxy. The requested resource must be accessed through a proxy.
306UnusedAn obsolete HTTP status code.
307Temporary RedirectTemporary redirect. Similar to 302. Uses GET to redirect.
400Bad RequestThe client’s request had a syntax error the server could not understand.
401UnauthorizedThe request requires user authentication.
402Payment RequiredReserved for future use.
403ForbiddenThe server understood the client’s request but refuses to execute it.
404Not FoundThe server could not find the resource (web page) based on the client’s request. With this code, web designers can set up a custom “requested resource not found” page.
405Method Not AllowedThe method in the client’s request is not allowed.
406Not AcceptableThe server could not fulfill the request based on the content characteristics requested by the client.
407Proxy Authentication RequiredThe request requires proxy authentication. Similar to 401, but the requester should authorize using a proxy.
408Request Time-outThe server waited too long for the request sent by the client and timed out.
409ConflictThe server may return this code when completing the client’s PUT request; a conflict occurred while processing the request.
410GoneThe resource requested by the client no longer exists. 410 differs from 404 — if a resource previously existed but is now permanently deleted, the 410 code can be used; web designers can specify the resource’s new location via the 301 code.
411Length RequiredThe server cannot process the request information sent by the client without a Content-Length.
412Precondition FailedThe precondition in the client’s request information is wrong.
413Request Entity Too LargeThe server cannot process the request because the entity is too large, so it refuses the request. To prevent repeated client requests, the server may close the connection. If the server is only temporarily unable to process it, it will include a Retry-After response.
414Request-URI Too LargeThe requested URI is too long (the URI is usually the web address), and the server cannot process it.
415Unsupported Media TypeThe server cannot process the media format attached to the request.
416Requested range not satisfiableThe range requested by the client is invalid.
417Expectation FailedThe server cannot satisfy the Expect request header.
500Internal Server ErrorInternal server error; the request could not be completed.
501Not ImplementedThe server does not support the requested functionality and cannot complete the request.
502Bad GatewayAs a gateway or proxy, the server received an invalid request from the upstream server.
503Service UnavailableThe server is temporarily unable to process the client’s request due to overload or maintenance. The duration may be included in the server’s Retry-After header.
504Gateway Time-outAs a gateway or proxy, the server did not get the request from the upstream server in time.
505HTTP Version not supportedThe server does not support the HTTP protocol version requested and cannot complete processing.