Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any difference between parameters in a URL and <form method="get">?

Tags:

http

url

limits

Now, I know a difference between parameters in a URL and a POST parameter: some browsers may misbehave if the URL is too long, so it is not a good idea to stuff hundreds of parameters in a URL, even if your app can respond to a GET request.

For the sake of discussion, let's suppose the following web application: a user can input a series of (possibly hundreds of) X,Y coordinates. The server plots them in a chart, which is returned as an image.

This is clearly an example of an idempotent operation, so, according to the HTTP spec, it is recommended to be implemented as a GET operation. However, you can't build a URL with all the parameters, as it will be too long. Can a <form method="get"> handle that much parameters ?

I've also heard that <form method="get"> is completely equivalent to placing parameters in a URL ? Now, is that true for some browsers or for the whole HTTP protocol ? Is there a maximum length to a request?

like image 711
Leonel Avatar asked Nov 05 '08 17:11

Leonel


1 Answers

The HTTP spec does not set limitations, but the browsers and servers do. See here for specifics.

The browser will create a long URL if the method is set to GET for a form, so the above limitations apply.

like image 158
Sunny Milenov Avatar answered Sep 28 '22 09:09

Sunny Milenov