HTTP request details

Source: Internet
Author: User

Get


The get method is used to obtain the information specified by the request URI (in Entity format ). If the request
Uri involves a data generation process, so the data generated in this process should be returned as an object in the response instead
The Source Text of the process, unless the source text is exactly the output of the process.
If the request message contains if-modified-since, if-unmodified-since, if-match, if-None-match or
If-range header field, the get syntax is changed to "condition all ". A conditional get method will request full
The entity of the condition header field. The condition get method is used to reduce unnecessary network usage, which allows the use of Cache
Objects that are still retained, instead of having to request or transmit the objects that the client already has ..
If the request method contains a range header field, the get method is changed to the "partial get" (partial get) method.
A part of GET requests a part of the object, which is described in section 14.35. Some get methods aim to reduce
Allows the client to obtain part of the Entity Data from the server without obtaining the client
Part of the object data already owned by the local device.
The GET request response is cacheable if the response meets the HTTP cache requirements in section 13th.
See section 15.1.3 for security considerations when get requests are used for forms.

Head

 


The head method is the same as the get method, except that the server cannot return the message body in the response. In the head Request Response
The meta information in the HTTP header must be consistent with the meta information in the GET request response.
This method is used to obtain the metadata of the Request Entity without transmitting the entity-body ). This method is often used
To test the validity, accessibility, and recent changes of hypertext links ..
The response of the head request can be cached, because the information in the response may be cached to update the cache corresponding to the previous resource.
.. If a new domain value indicates that the cached object is different from the object on the current source server (possibly because
Content-Length, Content-MD5, etag or last-modified value change), then cache (cache) must
The cache item must be considered obsolete (stale ).

 

Post

 


The post method is used to request the source server to accept the entity in the request as a new sub-object of the requested resource. Post is
The design covers the following features.
-- Annotations of existing resources;
-- Publish a message to a bulletin board, newsgroup, email list, or similar article group.
-- Provide a data block, such as submitting a form to a data processing process.
-- Expand the database through the append operation.
The actual function of the post method is determined by the server and is often dependent on the request URI (request-Uri ). Post
The submitted object is the subordinate object of the request URI, as if a file belongs to a directory, and a news article belongs to
A newsgroup or a record belongs to a database.
The action executed by the POST method may not work for the resource specified by the request URI. In this case, 200 (successful) or
204 (NO content) will be the appropriate response status, depending on whether the response contains an entity that describes the results.
If the resource is created by the source server, the response should be 201 (created) and contain an entity. This entity describes
Status. This new resource and a location header domain are referenced (see section 14.30 ).
POST method responses cannot be cached. Unless the response contains an appropriate cache-control or Expires header. However,
303 (see others) the response can be used by the user proxy to obtain a cacheable response.
POST requests must follow the requirements for message transmission as specified in section 8.2.
See section 15.1.3 for security considerations.

 

Put

 


The put method requests the server to store the objects in the request under the request URI (request-Uri) identifier. If the request
The resource specified by Uri (request-Uri) already exists on the source server, so the object in this request should be treated
Is the latest version of the resource entity specified by the source server for this URI. If the request URI (request-Uri) specifies
Resource does not exist, and the URI is defined as a new resource by the user proxy, the source server should
The entity creates a resource identified by this URI. If a new resource is created, the source server must be able to generate
The user agent sends a 201 (created) response. If the existing resource is changed, the source server should
Send a 200 (OK) or 204 (NO content) response. If the resource cannot be created or changed based on the request URI
An appropriate error response should be given to reflect the nature of the problem. The recipient of an object cannot ignore anything that it does not understand and cannot implement.
Content-* (for example, content-range) header, and must return a 501 (not implemented) response.
If the request passes through a cache and the request URI (request-Uri) indicates one or more current
The cached entities should be treated as old ones. The response of the put method cannot be cached.
The most fundamental difference between a POST method and a PUT Method request is that the meaning of a request URI is different. Post please
The URI in the request indicates a resource that can process the Request Entity.
Servlet ). This resource may be a data receiving process and a gateway
Yes: the gateway can perform protocol conversion, but the proxy cannot. It only acts as a proxy. For example, the cache server is actually
Proxy), or an entity that receives comments separately. In comparison, the URI in the PUT Method Request identifies
The entity-by-one user proxy knows what the URI means, and the server cannot apply this request to other resources
(Resource ). If the server expects the request to be applied to a different Uri, it must send 301
User Agent can decide whether to redirect the request.
A single resource may be specified by many different Uris. For example, an article may have a URI specifying the current version,
This URI is different from the URI of other special versions in this article. In this case, a put request to a general URI can
This may cause other URI requests to be redefined by the source server.
HTTP/1.1 does not define the impact of the put method on the status of the source server.
Put requests must follow the message transmission requirements in section 8.2.
Unless otherwise specified, the object header field in the put method request should be used for resource creation or modification.

 

Delete)

 


The delete method requests the source server to delete the resource specified by the request URI. This method may be artificially dry on the source server.
Involved (or through other methods ). The client cannot guarantee that this operation can be performed, even if the source server returns a success status code. However,
The server should not specify that the resource is successful unless it intends to delete the resource or move the resource to an inaccessible location.
If the response contains an entity that describes success, the response should be 200 (OK). If the delete action has not been executed,
The response should be 202 (accepted). If the Delete request method has been executed but the response does not contain entities
204 (NO content) response.
If the request passes through the cache and the request URI (request-Uri) specifies one or more cached current entities
Some cache items should be considered old. The response of the delete method cannot be cached.

 

Trace

 


The trace method is used to stimulate a remote request message loop at the application layer.
Try the network path of the server. The loop means that if you send one request, return a response. This is a request response loop ,).

The last receiver may be the source server, or a proxy that receives a request containing the max-forwards header value of 0.
Or gateway. A trace request cannot contain an object.
The trace method allows the client to know the data received by the other end of the Request chain, and use the data information
Test or diagnose. The via header field value (see 14.45) has a special purpose because it can be used as the trace information of the Request chain. Exploitation
The max-forwards header field allows the client to limit the length of the Request chain, which is very useful because it can be used to test the generation
The management chain forwards messages in an infinite loop.
If the request is valid, the response should include the entire request message in the entity body, and the response should contain
The Content-Type header field is the header field of "message/HTTP. The response of this method cannot be cached.

 

Connect)

 


The connect method is retained in the http1.1 protocol specification to be used as a proxy that can be dynamically switched to the tunnel.

HTTP request details

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.