HTTP defines the method of interacting with the server, except that the most common get,post we use are actually 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: The message ontology to send messages 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 required to create the resource based on the request, and if so, the server accepts the request content 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 does not point 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 successfully completed. If Request-uri has neither created nor modified the resource, 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 the Request-uri identifies one or more of the currently cached entities, those entities are considered expired. The response of this method is not cached.
2, Post and put request the fundamental difference
The URI of the post request represents the resource that processes the enclosing entity, which may be a data-receiving process, a gateway to some protocol, or a stand-alone entity that receives annotations. However, the URI in the put request represents the entity that is closed in the request-the user agent knows the target 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 judgment.
http/1.1 does not define how a put request affects the state of the original server.
The put request must comply with the information transfer requirements.
Unless otherwise stated, the entity headers in the put request should be used on the resource that was created or modified.