F
F
ftdvshejfdk2015-01-02 10:06:44
PHP
ftdvshejfdk, 2015-01-02 10:06:44

Which method for the search form to choose?

One point is interesting. What is the best GET or POST method to use for the search form on the site.
It is desirable if you explain all the pros and cons of both methods.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
neolink, 2015-01-02
@neolink

see how Google or Yandex does it - definitely GET:
- you can give a link to the search
- there will be no "send again" window when the page is updated,
well, according to the logic of the methods, nothing changes on your server, so it's better to use GET
from the minuses - you can't write requests longer than 2000 characters (limited maximum URL length in IE)

O
OnYourLips, 2015-01-02
@OnYourLips

If the request changes state, then definitely POST.
Otherwise, GET.
You should also read about REST methods.

R
Rsa97, 2015-01-02
@Rsa97

RFC 7231
It is recommended that GET and HEAD requests be used only for getting data, POST, PUT and DELETE requests for changing data.

E
Evgeny Troinov, 2015-01-02
@tot0ro

POST - for measuring data

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question