2024年5月28日发(作者:)

java状态代码(Java status code)

Nine point seven

When a Web server responds to a request from a browser or other

client program, its response is generally composed of the

following parts: a state line, several response heads, a blank

line, and a content document. Here's one of the easiest

responses:

The status line contains the HTTP version, the status code, and

the short description information corresponding to the status

code. In most cases, all response heads except Content-Type are

optional. But Content-Type is required, and it describes the

MIME type of the following document. Although most replies

contain a document, some do not include, for example, the

response to the HEAD request will never be attached to the

document. There are many state codes that are actually used to

identify a failed request that does not contain a document (or

only a brief error message).

When a user attempts to access a content on a server running

Internet information service (IIS) over HTTP, IIS returns a

numeric code that represents the state of the request. The

status code can indicate whether the request is successful or

not, and also reveals the exact reason for the failure of the

request.

1XX - information tips

These state codes represent temporary responses. The client

should be ready to receive one or more 1XX responses before

receiving the regular response.

The initial request of 100 - Continue has been accepted, and

the client should continue to send the rest of the request.

(HTTP 1.1 new)

101 - Switching Protocols server will be converted to another

protocol according to client's request (HTTP 1.1 new)

2XX - success

This type of state code indicates that the server successfully

accepts the client request.

200 - OK is normal, followed by replies to requests for GET and

POST documents.

The 201 - Created server has created the document, and the

Location header gives its URL.

202 - Accepted has accepted the request, but the processing has

not yet been completed.

The 203 - Non-Authoritative Information document has returned

normally, but some response headers may not be correct, because

the copy of the document is used, non authoritative information

(HTTP 1.1 new).

There is no new document for 204 - No Content, and the browser

should continue to display the original document. If the user

refreshes the page periodically, and Servlet can determine that