The method of HTTP requests nine

HTTP1.0 request defines three methods: GET, POST, HEAD

HTTP1.1 defines six request methods: PUT, DELETE, PATCH, OPTIONS, CONNECT, TRACE

1.get specified page request information, and returns the entity body (idempotent)

2.post submit data processing request to the designated resource data exists in the request body (non-idempotent)

Similarly 3.head get, but does not return the specific content, configured to obtain the header (idempotent)

4.put complete replacement update the specified resource data, not just the new (idempotent)

5.delete delete the specified data resources (power, etc.)

6.patch partial update the specified resource data (non-idempotent)

7.options allows the client to view support server http request method

8.connect reserved can connect to a proxy server pipe

9.trace tracing requests received by the server, for testing or diagnosis

 

The difference between GET and POST?

  1.) get parameter in the address bar, post parameter in the request body;

  2.) get request sending TCP packets only once, post TCP packet to be sent twice

  3.) get link requests can be saved, but not post

  4.) get request automatic browser cache, cache To manually set the post, so get back or refresh request is not a waste of resources, but the post will again request

  5.) get requests only supports URL encoded, but support multiple encoding post

Guess you like

Origin www.cnblogs.com/surui/p/11668823.html