Are you still asking about difference between HTTP request method
POST in 2019? Before we dive into it, let's see and compare the difference in their properties and behaviors:
|Backward / Refresh||No harm||Data will be resubmitted (browser should warn user of resubmission)|
|History||Parameters stored in browser history||Parameters not stored in browser history|
|URL Length||2048 characters||Unlimited|
|Data Type Restriction||ASCII only||No restriction. Allow binary data|
|Security||Unsafe as data is exposed in URL||Relatively safer as parameters will not be stored in browser history or server log.|
Please note that most of the browsers comply with the HTTP standard. The table above states the behavior difference between
POST on the browser, not the intrinsic difference.
HTTP Message difference between GET and POST
Let's draw the conclusion first, there is no much difference between GET and POST. Both of them are the request method in HTTP protocol, and HTTP protocol is based on TCP/IP application layer. Hence, regardless of whether GET or POST, they both are transmitted on the same application layer abiding the same protocol, so technically speaking, there is no difference in terms of data transmission.
One might be able to spot the first and major difference on the request first line.
GET /uri HTTP/1.1
POST /uri HTTP/1.1
When we want to include parameters,
GET method puts parameters into URL while
POST method puts parameters into message body.
GET /url?id=1234&value=true HTTP/1.1 Host: localhost
POST /url HTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded id=1234&value=true
POST are transmitting with TCP connection. We can use
GET and write parameters in URL, or
POST with parameters in body, either way is fine as long as the server supports the method.
Post was published on , last updated on .
Like the content? Support the author by paypal.me!