HTTP GET versus POST

Posted: (EET/GMT+2)

 

The HTTP protocol is becoming very important and it is worth studying. If you are developing web applications, one of the first concepts to understand is the difference between the GET and POST request methods.

Both methods send data from a browser to a web server, but they do so in different ways.

A GET request includes parameters as part of the URL:

GET /Search?q=Windows HTTP/1.0

This makes GET requests easy to bookmark or share.

A POST request sends the data as part of the HTTP request body:

POST /Login HTTP/1.0

POST is commonly used when submitting forms or transferring larger amounts of data.

As a general rule, GET requests retrieve information, while POST requests submit information to the server.

Choosing the appropriate request method makes web applications easier to understand and maintain. This knowledge is needed when building HTML forms or CGI applications.