HTTP Head Request

Source: Internet
Author: User


GET: Requests the specified page information and returns the entity principal.


HEAD: Only the header of the page is requested.



POST: The requesting server accepts the specified document as a new subordinate entity for the identified URI.



PUT: Supersedes the contents of the specified document from the data that the client sends to the server.



Delete: The requested server deletes the specified page.



OPTIONS: Allow clients to view server performance.



TRACE: The request server returns the resulting content in the entity body portion of the response.



PATCH: The entity contains a table that describes the differences from the original content represented by the URI.



Move: The requesting server moves the specified page to another network address.



Copy: The request server copies the specified page to another network address.



Link: Request the server to establish a link relationship.



UNLINK: Break link relationship.



Wrapped: Allows the client to send encapsulated requests.



Extension-mothed: Additional methods can be added without altering the protocol.



Official definition



The head method is the same as the Get method, except that the message body is not returned by the server response. In response to a head request, the HTTP header contains the same meta information as the response message for a GET request. This method can be used to get the meta information that is implied in the request without transmitting the entity itself. It is also often used to test the validity, usability, and recent modification of hyperlinks.



A HEAD request response can be cached, that is, the information in the response may be used to update the previously cached entity. If the current entity is different from the threshold of the cache entity (which can be indicated by changes in Content-length, CONTENT-MD5, ETag, or last-modified), then the cache is considered expired.



Nutshell



Head requests are often overlooked, but can provide a lot of useful information, especially at limited speeds and bandwidth. The main features are as follows:



1, only the first request for resources;



2, check the validity of hyperlinks;



3, check whether the webpage is modified;



4, more for automatic search robot to obtain Web page logo information, access to RSS seed information, or transmission of security certification information, etc.



Head method: It is almost the same as the Get method, and for the response part of the head request, the information contained in the HTTP header is the same as the information obtained through the GET request. Using this method, you can about the resources identified by Request-uri without transmitting the entire resource content. This method is commonly used to test the validity of hyperlinks, whether they can be accessed, and whether they have been updated recently.



Error code:



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 Head Request


Related Article

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.