HTTP Learning Notes

Source: Internet
Author: User

I am not with the web, never want to learn HTTP, and now run to learn HTTP, is forced helpless.

1. HTTP request method

Get request gets the resource identified by the Request-uriPost appends new data to the resource identified by Request-uri (not idempotent)HEAD request Gets the response message header for the resource identified by Request-uriPUT Request server stores a resource and uses Request-uri as its identity (idempotent)Delete Request server deletes the resource identified by the Request-uri trace request Server loopback received request information, primarily for testing or diagnosing connect reserved future use of Options request query server performance, or query resource-related options and requirements


Note: If a method repeats multiple times, the effect is the same, and that is idempotent (idempotent). The request data is not used in the Get method, but is used in the Post method.The Post method is useful for situations where a customer needs to fill out a form. The most commonly used request headers associated with request data are Content-type and content-length.

2. HTTP response messages

The status code consists of three digits, the first number defines the category of the response, and there are five possible values. 1XX: Indicates that the request has been received and continues processing. 2XX: Success-Indicates that the request has been successfully received, understood, accepted. 3XX: Redirect--further action is required to complete the request. 4XX: Client Error--the request has a syntax error or the request is not implemented. 5XX: Server-side error-the server failed to implement a legitimate request.

A description of the common status code and status is described below.

OK: Client request succeeded. Bad Request: Client requests have syntax errors and cannot be understood by the server. 401 Unauthorized: Request is not authorized, this status code must be used with the Www-authenticate header domain. 403 Forbidden: The server receives the request but refuses to provide the service. 404 Not Found: The request resource does not exist, for example: The wrong URL was entered. Internal Server error: Unexpected errors occurred on the server. 503 Server Unavailable: The server is currently unable to process client requests and may return to normal after a period of time, for example: http/1.1 OK (CRLF).

HTTP Learning Notes

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.