The message structure of HTTP and the meaning of status code

Source: Internet
Author: User

HTTP Response message Anatomy

Response message Structure

HTTP response messages are also made up of three parts ( response line + response Head + response body ):



The following is an actual HTTP response message:



① message protocol and version;
② Status code and status description;
The ③ response message header is also composed of several attributes;
④ response to the style, that is, we really want "dry".

Response Status Code

Compared with the request message, the response message has a "response status code", which tells the client the processing result of the request in a "clear and clear" language.

The HTTP response status code consists of 5 segments:

    • 1XX message, the general is to tell the client, the request has been received, is processing, don't worry ...
    • 2XX processing success, generally said: The request received, I understand what you want, the request has been processed, has been completed and other information.
    • 3xx Redirect to a different location. It allows the client to initiate a request again to complete the processing.
    • 4XX processing An error occurred, the responsibility of the client, such as the client's request for a non-existent resource, the client is not authorized, access is forbidden, etc.
    • 5XX processing error, the responsibility on the server side, such as the server throws an exception, routing error, HTTP version is not supported and so on.



Here are a few common status codes:

OK

What you would most like to see is the process of success!

303 See other

I redirect you to other pages where the URL of the target tells you by the location of the message header.

Quote Wukong: Master to a peach bar, walked a day Tang's monk: I have no peach! Go to Heavenly Queen and find it.



304 Not Modified

Tell the client that you requested this resource to the last time you obtained, and did not change, you directly with your local cache, I am very busy oh, you can not bother me!

404 Not Found

The last thing you want to see is that you can't find the page. If you find a page on Google, click on this link to return 404, that this page has been deleted by the site, Google's record is just a good memory.

Internal Server Error

See this error, you should check the service side of the log, must throw a bunch of anomalies, don't sleep, get up and change the bug!


Other status codes see: Http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

The message structure of HTTP and the meaning of status code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.