A form is used to pass information from a web browser to
a web server.There are two different ways that a form can be submitted from
your browser to the webserver. In HTML, this is how one would define the
opening form tags for both submission methods: <form
method="GET"> and <form method="POST">.
If a "GET" request is used, the form parameters
are encoded in the URL in what is called a query string.
www.example.com/?login=usetricks@email.com&password=xxyz
In the GET request above, you can see that the form
parameters (login and password) are attached to the end of the URL itself.
A POST request, unlike a GET request, passes the form
parameters in the body of the HTTP request, not in the URL.
Here i am showing the Comparison chart between GET and POST
methods
GET
Method ():
1.form parameters is appended to the URL.
2.Data is not secret it is public.
3.It is a single call system
4.GET is less secure compared to POST because data sent
is part of the URL. So it's saved in browser history and server logs in
plaintext.
5.GET method is visible to everyone (it will be displayed
in the browser's address bar) and has limits on the amount of information to
send.
6.7607 character maximum size.
7.Can be cached.
POST
Method ():
1.form parameters is not appended to the URL.Post Method
passes the form parameters in the body of the HTTP request, not in the URL.
2.Data is secret it is not public in post method.
3.It is a two call system .
4.POST is a little safer than GET because the parameters
are not stored in browser history or in web server logs.
5.POST method variables are not displayed in the URL.
6.8 Mb max size for the POST method.
7.Can not be cached.