How to put the HTTP submission in detail and the difference between post and put

Source: Internet
Author: User

HTTP defines the method of interacting with the server, except that most of the get,post we use actually have put and delete

According to the RFC2616 standard (current http/1.1) there are actually options,get,head,post,put,delete,trace,connect

Simply end it.

1, put: Send messages in the message ontology to a URL, similar to post, but not commonly used.

Simply put: it is usually used to send a request to the server, and if the URI does not exist, the server is asked to create the resource on request, and if so, the server accepts the request and modifies the original version of the URI resource.

-----Put requests those entities that are encapsulated in Request-uri. If Request-uri references an existing resource, the encapsulated entity should act as a modified version on the original server. If Request-uri is not pointing to an existing resource, and the URI can be defined as a new resource by the requested user code, the original server can create a new resource with this URI. If a new resource is created, the original server must notify the user agent through the 201 (Created) response. If an existing resource is modified, a 200 or 204 response is sent, indicating that the request was completed successfully. If Request-uri has neither created nor modified resources, appropriate error responses should be given to reflect the nature of the problem. The recipient of an entity cannot ignore any content-* (such as content-range) headers that are not understood or implemented, and must return a 501 response.

If the request is cached and Request-uri identifies one or more currently cached entities, those entities are considered to be out of date. The response of the method is not cached.

2. Post and put requests are fundamentally different

The URI of the post request represents a resource that processes the enclosing entity, which may be a data ingestion process, a gateway to a protocol, or an independent entity that receives annotations. However, the URI in the put request represents the closed entity in the request-the user agent knows the destination of the URI, and the server cannot apply the request to other resources. If the server wants the request to be applied to another URI, it must send a 301 response, and the user agent can decide whether to forward the request by its own discretion.

http/1.1 does not define how a put request affects the state of the original server.
Put requests must comply with information transfer requirements.
Unless otherwise noted, the head of the entity in the put request should be used on the resource where the put is created or modified.

How to put the HTTP submission in detail and the difference between post and put

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.