❝
As an Internet developer, the meaning of the HTTP status returned by some servers must be well known. Only by making clear these status codes one by one can various problems encountered in the work be handled with ease. So let’s take a look at some of the more common HTTP status codes.
❞
The HTTP status code
1xx – Message prompt
❝
These status codes represent temporary responses. Clients should be prepared to receive one or more 1XX responses before receiving regular responses.
❞
- 100 –
Continue
The initial request has been accepted and the client should continue to send the rest of the request. (New in HTTP 1.1) - 101 –
Switching Protocols
The server will comply with the client’s request to another protocol (new in HTTP 1.1)
2 xx – success
❝
This type of status code indicates that the server successfully accepted the client request.
❞
- 200 –
OK
Everything is fine, and the reply documents for the GET and POST requests follow. - 201 –
Created
The server has created the document, and the Location header gives its URL. - 202 –
Accepte
D has accepted the request, but processing is not yet complete. - 203 –
Non-Authoritative Information
The document has returned normally, but some of the reply headers may be incorrect because a copy of the document is used, unauthoritative information (new in HTTP 1.1). - 204 –
No Content
Without a new document, the browser should continue to display the original document. This status code is useful if the user refreshes the page periodically and the Servlet can determine that the user document is sufficiently new. - 205 –
Reset Content
There is no new content, but the browser should reset what it shows. Used to force the browser to clear form input (new in HTTP 1.1). - 206 –
Partial Content
The customer sent a message withRange
The head of theGET
Request (block request), the server completes it (new in HTTP 1.1).
3xx – Redirect
❝
The client browser must do more to fulfill the request. For example, the browser might have to request a different page on the server, or repeat the request through a proxy server.
❞
- 300 –
Multiple Choices
The document requested by the customer can be found in multiple locations that are already listed in the returned document. If the server wants to propose a preference, it should be indicated in the Location reply header. - 301 –
Moved Permanently
The document the customer requested is elsewhere, the new URL is given in the Location header, and the browser should automatically access the new URL. - 302 –
Found
Similar to 301, but the new URL should be seen as a temporary replacement, not permanent. Note that in HTTP1.0 the corresponding status information isVersion Temporatily"
. When this status code appears, the browser automatically accesses the new URL, so it’s a useful status code. Note that this status code can sometimes be substituted with 301. For example, if the browser requests it incorrectlyhttp://host/~user
(missing the trailing slash), some servers return 301, others 302. Strictly speaking, we can only assume that the browser automatically redirects only when the original request is a GET. For details, see 307. - 303 –
See Other
Similar to 301/302, except that if the original request was POST, the redirected target document specified by the Location header should be extracted via GET (new in HTTP 1.1). - 304 –
Not Modified
The client has the buffered document and makes a conditional request (typically to provideIf-Modified-Since
The header indicates that the customer only wants documents that are up to date). The server tells the client that the originally buffered document can still be used. - 305 –
Use Proxy
The documents requested by the customer should passLocation
Header indicates proxy server extraction (new in HTTP 1.1). - 307 –
Temporary Redirect
Same as 302 (Found). Many browsers mistakenly redirect in response to a 302 reply, even though the original request was A POST, and even though it can actually redirect only if the reply to a POST request is 303. For this reason, HTTP 1.1 added 307 to make it easier to distinguish between several status codes: browsers can follow redirected GET and POST requests when a 303 reply occurs; If it is 307, the browser can only follow the redirection of the GET request. (New in HTTP 1.1)
4xx – Client error
❝
An error occurred. The client seems to have a problem. For example, if a client requests a page that does not exist, the client does not provide valid authentication information.
❞
- 400 – Bad Request A syntax error occurs in the Request.
- 401 – Unauthorized Access Was denied. A customer attempted to gain Unauthorized access to a password-protected page. The response contains a www-Authenticate header, which the browser uses to display the user name/password dialog box and re-issue the request after filling in the appropriate Authorization header. IIS defines a number of different 401 errors that specify more specific causes of the error. These specific errors · 401.1 – Login failure.
- 401.2 – Login failed due to server configuration.
- 401.3 – Not authorized due to ACL resource restrictions.
- 401.4 – Filter authorization failed.
- 401.5 –
ISAPI/CGI
Application authorization failed. Procedure - 401.7 – Access denied by URL authorization policy on Web server. This error code is
IIS 6.0
What is special.
- 403 –
Forbidde
N The resource is unavailable. The server understands the client’s request, but refuses to process it. This is usually caused by permission Settings on files or directories on the server. Access forbidden:IIS
There are a lot of different definitions403
Error, they refer to the more specific cause of error:- 403.1 – Execution access is disabled.
- 403.2 – Read access disabled.
- 403.3 – Write access is disabled.
- 403.4 requirements
SSL
. - 403.5 requirements
SSL 128
. - 403.6 –
IP
The address was rejected. - 403.7 – Client certificate required.
- 403.8 – Site access denied.
- 403.9 – Too many users.
- 403.10 – Invalid configuration.
- 403.11 – Password change.
- 403.12 – Access to the mapping table is denied.
- 403.13 – The client certificate is revoked.
- 403.14 – Reject directory list.
- 403.15 – Exceeded client access permission.
- 403.16 – Client certificate not trusted or invalid.
- 403.17 – The client certificate has expired or has not taken effect.
- 403.18 – Requested cannot be executed in the current application pool
URL
. This error code isIIS 6.0
What is special.
- 403.19 – Cannot be executed for clients in this application pool
CGI
. This error code isIIS 6.0
What is special. - 403.20 –
Passport
Login failed. This error code isIIS 6.0
What is special. - 404 –
Not Found
The resource at the specified location could not be found. This is also a common response. - 404.0 – (None) – No files or directories found.
- 404.1 – The Web site cannot be accessed on the requested port.
- 404.2 –
Web
Service extension locking policy prevents this request. - 404.3 –
MIME
The mapping policy prevents this request. - 405 –
Method Not Allowed
Request method (GET
,POST
,HEAD
,DELETE
,PUT
,TRAC
E, etc.) does not apply to the specified resource and is used to access this pageHTTP
Predicates not allowed (methods not allowed) (new in HTTP 1.1) - 406 –
Not Acceptable
The specified resource has been found, but itsMIME
Type and customer inAccpet
Incompatible as specified in the header. The client browser does not accept the requested pageMIME
Type (HTTP 1.1 new). - 407 –
Proxy Authentication Required
Proxy authentication is required, similar to 401, which means that the client must first be authorized by the proxy server. (New in HTTP 1.1) - 408 –
Request Timeout
The client has not made any requests during the server license wait time. The customer can repeat the same request at a later date. (New in HTTP 1.1) - 409 –
Conflict
Usually associated with PUT requests. The request cannot succeed because it conflicts with the current state of the resource. (New in HTTP 1.1) - 410 –
Gone
The requested document is no longer available, and the server does not know which address to redirect to. It differs from 404 in that returning 407 means the document has permanently left the specified location, whereas 404 means due to unknown
Cause The document is unavailable. (New in HTTP 1.1)
- 411 –
Length Required
The server cannot process the request unless the client sends a Content-Length header. (New in HTTP 1.1) - 412 –
Precondition Failed
Some preconditions specified in the request header fail (new in HTTP 1.1). - 413 –
Request Entity Too Large
The size of the target document is larger than the server is currently willing to process. If the server thinks it can process the request later, it should provide a retry-after header (new in HTTP 1.1). - 414 –
Request URI Too Long URI
Too long (new in HTTP 1.1). - 415 – Unsupported media types.
- 416 –
Requested Range Not Satisfiable
The server could not satisfy the Range header specified by the customer in the request. (NEW in HTTP 1.1) · 417 — Execution failed. - 423 — Locking error.
5xx – Server error
❝
The server could not complete the request because it encountered an error.
❞
- 500 – Internal Server Error The Server encountered an unexpected condition and could not complete the customer’s request.
- 500.12 – The application is busy restarting on the Web server.
- 500.13 – Web server too busy.
- 500.15 – Direct requests to global.asa are not allowed.
- 500.16 — The UNC authorization credentials are incorrect. This error code is specific to IIS 6.0.
- 500.18 — URL authorization store cannot be opened. This error code is specific to IIS 6.0.
- 500.100 – Internal ASP error.
- 501 –
Not Implemented
The server does not support the functionality required to implement the request, and the header value specifies the unimplemented configuration. For example, a customer makes a PUT request that is not supported by the server. - 502 –
Bad Gateway
When a server, acting as a gateway or proxy, accesses the next server to complete a request, but the server returns an invalid reply. Also said that the Web server used as a gateway or proxy server received an invalid response.- 502.1 –
CGI
The application timed out. - 502.2 –
CGI
Application error. - 503 –
Service Unavailable
The service is unavailable and the server is not responding due to maintenance or heavy load. For example, the Servlet might return 503 if the database connection pool is full. The server can provide a retry-after header when it returns 503. This error code is specific to IIS 6.0.
- 502.1 –
- 504 –
Gateway Timeout
Gateway timeout, used by the server acting as a proxy or gateway, indicates that a reply cannot be received from the remote server in a timely manner. (New in HTTP 1.1). 505 –HTTP Version Not Supported
The server does not support the HTTP version specified in the request. (New in HTTP 1.1)
Reference:
- Common HTTP status codes