GET vs. POST (form processing)

I fully understand the differences between the two regarding form processing, user privacy, and data privacy, but in what situation would someone rather use GET over POST when submitting form results?

thanks

+6
post get html-form
source share
4 answers

GET sets parameters in the URL itself, allowing everyone to see. Although POST would be ideal for logins and security-sensitive data, GET is ideal if you want a dynamic page to be bookmarked.

Take the forum, for example. A stream that displays all the messages inside it is loaded dynamically. There does not exist a page for each available stream, that is, parameters should be specified that indicate which stream to load. These parameters are passed using GET so that you can add bookmarks to the page, and so that the exact URL with the provided parameters is used again to load the page.

+6
source share

W3C HTML 4.01 Recommendation for the proper use of GET and POST:

The get method should be used when the form is idempotent (i.e. does not cause side effects). Many searches in the database have no visible side effects and make ideal applications for the get method.

If the service associated with processing the form causes side effects (for example, if the form modifies the database or subscribing to the service), use the "post" method.

Note. The get method restricts the values ​​of the form dataset to ASCII characters. Only the "post" method (with enctype = "multipart / form-data") is specified to cover the entire character set [ISO10646].

+11
source share

For example, to make form data visible in magazines.

+2
source share

If I need the user to be able to save the bookmark of the next step / page (for any reason), I would use GET, besides this, possibly POST.

Both are unsafe and you should avoid both.

+1
source share

All Articles