[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] POST or GET


At 05:40 AM 9/5/2003, Dimitris Papaharisis wrote:
a question of style (and maybe functionality).

What is the recommended way of linking to other modules / runmodes. Is GET
good enough or should I be using POSTs?

and when I went to the next mode, a GET was performed and all the params
where in the URL (including password which is not very nice)

If you use GET, the user can reload the page without being prompted by the browser. It is generally used for fetching pages that don't have any side-effects, such as getting a list of items in a database. You can also build your own "GET" inside an HREF. For example, each of the items in that list page could have a link to a detail page for that item, with all the necessary data in the query string. If you were to use POST, you'd have to create an actual form.

If you use POST, the user will be prompted by the browser if they want to resubmit the information when they reload. It is generally used for things that have side effects, such as adding an entry to a database. It is also used when you don't want the query string showing up in the returned page, or when there is a lot of data being sent, as there is a smaller limit on the length of GET requests.

The prompting is at least in IE 5+, I'm not sure about other browsers. The separation of intents for GET and POST goes all the way back to the initial CGI spec, I believe.

--
Greg Marr
suppressed


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.