POST vs GET method for search form in CMS

I'm a little stuck in one. I just can't decide whether to use the POST or GET method in my search form.

Normally, I would use the GET method for this form so that users can bookmark their results. But this time, the search form is present in the administration area, so the results are relevant in the near future, and there is no need to add bookmarks to the results, and, of course, they are not publicly available to everyone.

To be more specific, the search function is intended to be used with a list of users, so a specific user to search can be defined. My idea was to use the POST method, where the form would be redirected to one page, so I would get a list of users filtered by the search bar. There was also pagination, so I would add a search bar for each pagination link (next page, previous page, first page and last page) so that the search bar would not be lost later (during any session following the search, e.g. pagination of search results, etc.).

There is no obvious reason to prefer one after the other, both can be used. The POST method will be a bit more complicated, but on the other hand, there are advanced options in the search form (about 5 flags), and I donโ€™t like the idea of โ€‹โ€‹having a string with a URL string with too many values โ€‹โ€‹(and I expect users to not use it often pagination after a search session, so the values โ€‹โ€‹will not get into the address bar as often) if the POST method is used.

Which one do you prefer to look for in CMS and similar systems?

Thanks everyone!

+8
html post architecture get administration
source share
2 answers

You get the data, so use a GET. POST will create problems with updating and returning.

Do not dwell on the beauty of your URIs, they are an instrument, not a work of art.

+43
source share

Perhaps I would (mostly) always choose a post on top of get, it is more accurate and refreshing, and problems with the mail method are things from the past in any large browser, they just ask you if you want to resend the data, right ?

An exception to MAJOR would be the bookmarking of a dynamic web page (e.g. movieweb.com/movies.php?movie=the_three_mosqueteers, for example), but still, if that is not the case, I think it's better to use POST.

+2
source share

All Articles