HTTP Methods: Difference Between GET and POST

HTTP method: GET vs POST


GET method
parameters are sent in the URL

/test/demo_form.asp?name1=value1&name2=value2 The

parameters are separated by "?" The
parameters are sent in the form of (name/value pair)
The parameters are separated by "&" ” separate

GET requests can be cached
GET requests are kept in browser history
GET requests can be bookmarked
GET requests should not be used when dealing with sensitive data
GET requests have a length limit (the maximum URL length is 2048 characters)
GET requests Should only be used to retrieve data



POST method
parameters Send POST in HTTP message body

/test/demo_form.asp HTTP/1.1
Host: w3schools.com
name1=value1&name2=value2

Parameters are sent in the form of (name/value pair) Used between
parameters "&" separated

POST requests will not be cached
POST requests will not be kept in browser history
POST cannot be bookmarked
POST requests have no data length requirements



Other
HTTP request methods HEAD is the same as GET, but only returns HTTP headers, no Returns the body of the document.
PUT uploads the specified URI representation.
DELETE deletes the specified resource.
OPTIONS Returns the HTTP methods supported by the server.
CONNECT converts the request connection to a transparent TCP/IP channel.



Any characters that appear after the first # character after the URL #
will be interpreted by the browser as a location identifier. This means that none of these characters are sent to the server.

Just change the part after #, the browser will only scroll to the corresponding position, and will not reload the page.
For example, changing from http://www.example.com/index.html#location1 to
http://www.example.com/index.html#location2, the browser will not re-request index.html from the server.

Every time you change the part after #, a record will be added to the browser's access history, and you can go back to the previous position by using the "back" button.
Note that the above rules don't hold for IE 6 and IE 7, they don't add history because of # changes.

window.location.hash read
#value window.location.hash This property is readable and writable. When reading, it can be used to judge whether the status of the web page has changed; when writing, it will create an access history record without
reloading . The character connection



after URL ? : for example http://www.xxx.com/Show.asp?id=77&nameid=2905210001&page=1 Clear the cache: for example




http://www.xxxxx.com/index.html
http://www.xxxxx.com/index.html?test123123
The pages opened by the two urls are the same, but there is a question mark in the latter, indicating that the cached content is not called, and Consider it a new address and re-read. Spacers for different parameters of



the characters after URL & Reference original text: http://www.w3school.com.cn/tags/html_ref_httpmethods.asp Reference original text: http://www.cnblogs.com/kaituorensheng/p/3776527.html







Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326998198&siteId=291194637