Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the GET method faster than POST in HTTP?

Tags:

http

post

get

I am new to web programming and just curious to know about the GET and POST methods of sending data from one page to another.

It is said that the GET method is faster than POST but I don't know why. One reason I could find is that GET can take only 255 characters? Is there any other reason? Please someone explain to me.

like image 225
Embedd_0913 Avatar asked Jul 31 '09 10:07

Embedd_0913


People also ask

Why is GET better than POST?

GET is less secure than POST because sent data is part of the URL. POST is a little safer than GET because the parameters are stored neither in the browser history nor in the web server logs.

Why is GET used more than POST?

POST is also more secure than GET , because you aren't sticking information into a URL. And so using GET as the method for an HTML form that collects a password or other sensitive information is not the best idea. One final note: POST can transmit a larger amount of information than GET .

Is POST slower then GET?

GET may be considered slightly faster in that it contains less overhead, but the difference should be essentially negligible. The difference between the two is based on other factors.

Which method is better GET method or POST method?

GET performs are better compared to POST because of the simple nature of appending the values in the URL. It has lower performance as compared to GET method because of time spent in including POST values in the HTTP body. This method supports only string data types.


1 Answers

It's not much about speed. There are plenty of cases where POST is more applicable. For example, search engines will index GET URLs and browsers can bookmark them and make them show up in history. As a result, if you take actions like modifying a DB based on a GET request, it might be harmful as some bots might also traverse the URL.

The other case can be security issue. If you post credentials using GET, it'll get listed in browser history and server log files.

like image 68
mmx Avatar answered Sep 23 '22 01:09

mmx