I am studying the HTTP methods. I read that GET request can be bookmarked and POST request can not be bookmarked. Can anybody explain this with an example?
Thanks
POST. HTTP POST requests supply additional data from the client (browser) to the server in the message body. In contrast, GET requests include all required data in the URL.
So, yes, you are allowed to send an entity-body with a HTTP GET request.
1. GET retrieves a representation of the specified resource. POST is for writing data, to be processed to the identified resource.
GET is used to request data from a specified resource. Some notes on GET requests: GET requests can be cached. GET requests remain in the browser history.
An HTTP POST can be bookmarked, but since a bookmark only consists of the URL, all of the form parameters will be lost. This will often mean that the web server doesn't know what to do with the request, since it was expecting some form parameters.
If you submit a form via a GET request, all of the form parameters go into the URL (after the ?), so a bookmark will contain all of the information needed for the webserver to rebuild the page a second time (except for cookies, perhaps, but a webserver is more likely to handle that gracefully)
A POST cannot be bookmarked. Attempting to bookmark a POST will just result in a GET operation on the URL. There's a very good reason for this, GET requests are supposed to be idempotent - that is, making the same GET request numerous times should result in the same response. POST requests on the other hand are not. Allowing POSTs to be bookmarked could result in you paying for something twice, transferring money out of your bank account again, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With