HTTP request methods

 

 


Methods

 

HEAD /echo/head/json HTTP/1.1

GET /echo HTTP/1.1

POST /echo/post/json HTTP/1.1

PUT /new.html HTTP/1.1

OPTIONS / HTTP/1.1

 


PUT vs POST

 

它們功能差不多, 不同在於對 Request-URI 的理解

PUT 用於 update or replace an existing resource on the server,

while the POST method is used to add a resource on the server.

PUT Request Method

If the Request-URI does not point to an existing resource,

the origin server MAY add a new resource with that URI.

To partially replace an existing resource, use the PATCH request method.