In HTTP get and post

Difference in HTTP get and post the

  • GET - request data from the specified resource.
  • POST - submission of data to be processed to the specified resource
GET POST
Back / Refresh harmless Data will be resubmitted
Bookmark Can be bookmarked Not bookmarked
Cache Be cached You can not cache
Encoding type application More use of multiple encoded as a binary data
history Parameters will remain in history Not saved in the historical data
Restrictions on the length of Up to 2048 Unlimited
Restrictions on data type ASCII There is no limit, it may be a binary data
safety Poor security, sensitive data, passwords, do not use the High security
Visibility Data visible to everyone in the URL Data is not limited to the URL

common problem:

  1. GET method parameters are fixed it?

    Our argument is written in the convention? Later, with & division process to resolve the messages, obtain Header and Body with regular expressions TCP data acquisition tools

  2. GET length limit:

    The parameter browser address bar is limited, Http agreement no length limit, restrict the length of URl is usually the cause browser or server

  3. POST than GET security:

    Because the POST data is not visible in the address bar, but security is only relative, because HTTP is transmitted in the clear on the network, to encrypt, you must use HTTPS

  4. POST will have two TCP packets?

    Header and Body POST will be sent separately, the HTTP protocol but not explicitly generates two packets, and the time the actual test is not transmitted separately, the method of transmitting only part of the browser request and the frame separately, do not belong to the POST inevitable behavior.

Please talk about the essential difference between both GET and POST:

Both the GET and POST nature without any distinction. They are the request method HTTP protocol. The underlying implementation is based on TCP / IP protocol. Above the so-called difference, but the browser manufacturers convention, it did limit

HTTP request, initially set eight methods. There is no difference on the nature of the eight methods. Just make a request, more semantics only.

  • Back OPTIONS request method supported by the server
  • GET Gets the specified resource to the server
  • HEAD GET consistent with, but the body does not respond to return, only to return response headers
  • POST to submit data to the server, where the data in the request body
  • PUT and POST similar, but having idempotent characteristics, typically for updating
  • DELETE to delete the specified resource server
  • TRACE echo server-side requests received, this will be used when testing

Guess you like

Origin www.cnblogs.com/pythonywy/p/11449043.html