If a GET
request is used, the form parameters are encoded in the URL in what is called a query string.For example
www.someemailprovider.com/?login=joe@email.com&password=xxyz
A POST
request, unlike a GET request, passes the form parameters in the body of the HTTP request, not in the URL.
Moreover GET
is idempotent and POST
is not that means If you call GET method on server nothing will be changed on server, but if you call POST then server will be changed may be a some additional data will be added in to the server, so GET is idempotent while POST is not.
Note
The main thing to keep in mind as a programmer is that defining your form to use the GET method does not protect against causing changes. You could use a GET request to do pretty much the same thing as a POST query. It’s just that browsers are generally coded to expect that POST requests will be used for things that will cause changes – like placing an order, or writing to a database, etc . GET requests should be used for pure queries that don’t affect anything on the server. So, one should always remember not to use GET requests for any action that would cause a change on the server – like ordering a big screen tv.