HTTP Status Codes Explained

Songqin Software Testing

Adhere to the Educational Original Intention

Both Ask for Harvest and Cultivation

HTTP Status Codes

1xx (Informational Responses)

These status codes indicate that the request has been received and that the requester should continue with the operation.

100 (Continue)

The requester should continue with the request. The server returns this code to indicate that it has received the first part of the request and is waiting for the remaining part.

101 (Switching Protocols)

The requester has asked the server to switch protocols, and the server has confirmed and is ready to switch.

2xx (Successful) indicates that the request has been successfully processed.

200 (OK)

The server has successfully processed the request. Usually, this means the server has provided the requested webpage. If this status code is displayed for your robots.txt file, it indicates that Googlebot has successfully retrieved the file.

201 (Created)

The request has succeeded, and the server has created a new resource.

202 (Accepted)

The server has accepted the request but has not yet processed it.

203 (Non-Authoritative Information)

The server has successfully processed the request, but the returned information may be from another source.

204 (No Content)

The server successfully processed the request but did not return any content.

205 (Reset Content)

The server successfully processed the request but did not return any content. Unlike the 204 response, this response requires the requester to reset the document view (e.g., clear form content to enter new content).

206 (Partial Content)

The server successfully processed a partial GET request.

3xx (Redirection)

Further action is required to complete the request. Typically, these status codes are used for redirection. Google recommends that you do not exceed 5 redirects in each request. You can use webmaster tools to check if Googlebot encounters issues when crawling redirected pages. The Diagnostics section under the Crawl page lists URLs that Googlebot could not crawl due to redirect errors.

300 (Multiple Choices)

For the request, the server can perform multiple operations. The server can select one operation based on the requester (user agent) or provide a list of operations for the requester to choose from.

301 (Moved Permanently)

The requested webpage has been permanently moved to a new location. When the server returns this response (in response to a GET or HEAD request), it automatically redirects the requester to the new location. You should use this code to inform Googlebot that a webpage or site has been permanently moved to a new location.

302 (Found)

The server is currently responding to the request from a different location, but the requester should continue to use the original location for future requests. This code is similar to the 301 code in responding to GET and HEAD requests and will automatically redirect the requester to a different location, but you should not use this code to inform Googlebot that a webpage or site has moved, as Googlebot will continue to crawl and index the original location.

303 (See Other)

The requester should use a separate GET request to retrieve the response from a different location when the server returns this code. For all requests except HEAD, the server will automatically redirect to another location.

304 (Not Modified)

The requested webpage has not been modified since the last request. When the server returns this response, it does not return the webpage content. If the webpage has not changed since the requester’s last request, you should configure the server to return this response (known as the If-Modified-Since HTTP header). The server can inform Googlebot that the webpage has not changed since the last crawl, thus saving bandwidth and overhead.

305 (Use Proxy)

The requester can only access the requested webpage using a proxy. If the server returns this response, it also indicates that the requester should use a proxy.

307 (Temporary Redirect)

The server is currently responding to the request from a different location, but the requester should continue to use the original location for future requests. This code is similar to the 301 code in responding to GET and HEAD requests and will automatically redirect the requester to a different location, but you should not use this code to inform Googlebot that a webpage or site has moved, as Googlebot will continue to crawl and index the original location.

4xx (Client Errors) These status codes indicate that there may be an error with the request that prevents the server from processing it.

400 (Bad Request)

The server cannot understand the syntax of the request.

401 (Unauthorized)

The request requires authentication. The server may return this response for webpages requested after login.

403 (Forbidden)

The server refuses to fulfill the request. If you see this status code when Googlebot tries to crawl valid webpages on your site (you can see this information in the Crawl page under the Diagnostics tab of Google Webmaster Tools), it may be that your server or host is denying Googlebot access.

404 (Not Found)

The server cannot find the requested webpage. For example, this code often returns for webpages that do not exist on the server. If your site does not have a robots.txt file and you see this status code on the robots.txt page in Google Webmaster Tools under the Diagnostics tab, it is the correct status code. However, if you have a robots.txt file and see this status code, it indicates that your robots.txt file may be misnamed or located in the wrong place (the file should be located at the top domain, named robots.txt). If you see this status code for URLs that Googlebot crawls (in the HTTP error page under the Diagnostics tab), it indicates that the link followed by Googlebot may be an invalid link (an old link or a mistyped link).

405 (Method Not Allowed)

The method specified in the request is not allowed.

406 (Not Acceptable)

The requested content characteristics cannot be used to respond to the requested webpage.

407 (Proxy Authentication Required)

This status code is similar to 401 (Unauthorized) but specifies that the requester should authorize using a proxy. If the server returns this response, it also indicates that the requester should use a proxy.

408 (Request Timeout)

The server timed out waiting for the request.

409 (Conflict)

The server encountered a conflict while processing the request. The server must include information about the conflict in the response. The server may return this code in response to a PUT request that conflicts with a previous request, along with a list of differences between the two requests.

410 (Gone)

If the requested resource has been permanently deleted, the server will return this response. This code is similar to 404 (Not Found), but is sometimes used to replace the 404 code in cases where the resource previously existed and now does not. If the resource has been permanently moved, you should use 301 to specify the new location of the resource.

411 (Length Required)

The server refuses to accept requests that do not contain a valid content-length header field.

412 (Precondition Failed)

The server did not meet one of the preconditions set by the requester in the request.

413 (Payload Too Large)

The server cannot process the request because the payload is too large and exceeds the server’s capacity.

414 (URI Too Long)

The requested URI (usually a URL) is too long for the server to process.

415 (Unsupported Media Type)

The requested format is not supported by the requested webpage.

416 (Range Not Satisfiable)

If the server cannot provide the requested range, it will return this status code.

417 (Expectation Failed)

The server did not meet the requirements of the “Expect” request header field.

5xx (Server Errors) These status codes indicate that the server encountered an internal error while processing the request. These errors may be due to issues with the server itself rather than errors in the request.

500 (Internal Server Error)

The server encountered an error and could not complete the request.

501 (Not Implemented)

The server does not have the functionality to fulfill the request. For example, this code may be returned when the server cannot recognize the request method.

502 (Bad Gateway)

The server received an invalid response from an upstream server while acting as a gateway or proxy.

503 (Service Unavailable)

The server is currently unable to handle the request (due to overload or maintenance). Typically, this is just a temporary state.

504 (Gateway Timeout)

The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server.

505 (HTTP Version Not Supported)

The server does not support the HTTP protocol version used in the request.

ღ The End ღ

Let’s Learn Testing Together at Songqin

Leave a Comment