HTTP works as a request-response protocol between a client and server. A web browser may be the client, and an application on a
computer that hosts a web site may be the server. Two commonly used HTTP methods to make a request to the server are GET and POST.
When you use GET method, the data will be sent to the server as a query parameters. These are appended to the URL as
a key value pair. In the below URL, you can see how data is passed to the server as key value pair. These values will be visible at
the address bar. URL character length is limited, so you can not use it if you are sending large data. GET is recommended to use for
querying information from server, kind of search operations. GET requests should never be used when dealing with sensitive data.
http://java2novice.com/history?name=madhu&language=java
POST method sends data as part of HTTP message body, data sent to the server, will not be visible to the user. POST requests
cannot be cached. It does not have any character length restrictions. POST is recommended to submits data to be processed to a specified resource.
|