Ch- 6 DWD
Difference between GET and POST
Sr. No
|
GET
|
POST
|
1
|
GET request is sent via the URL string
(appended to the URI with a question-mark as separator), which is visible.
|
POST request is encapsulated in the
body of the HTTP request and can't be seen.
|
2
|
GET request goes via URL, so it has a
limitation for its length. It can't be more than 255 characters long.
|
POST request becomes a part of the
body of the HTTP request and there is no size limitation.
|
3
|
GET request is comparatively faster as
it's relatively simpler to create a GET request.
|
The time spent in the encapsulation of
the POST request in the HTTP body is saved in this case.
|
4
|
Only ASCII characters allowed. GET
request is sent via URL string and as we all know that URL can be text-only,
so GET can carry only text data.
|
No restrictions. Binary data is also
allowed. POST has no such restriction and it can carry both text as well as
binary data.
|
5
|
GET is less secure compared to POST
because data sent is part of the URL. Never use GET when sending passwords or
other sensitive information!
|
POST is a little safer than GET
because the parameters are not stored in browser history or in web server
logs
|
6
|
Data is visible to everyone in the URL.
|
Data is not displayed in the URL.
|