Is it valid to combine a form POST with a query string?

Is it valid according HTTP specifications ?

Yes.

Here is the general syntax of URL as defined in those specs

http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]]

There is no additional constraints on the form of the http_URL. In particular, the http method (i.e. POST,GET,PUT,HEAD,…) used don’t add any restriction on the http URL format.

When using the GET method : the server can consider that the request body is empty.

When using the POST method : the server must handle the request body.

Is it a good idea ?

It depends what you need to do. I suggest you this link explaining the ideas behind GET and POST.

I can think that in some situation it can be handy to always have some parameters like the user language in the query part of the url.

Leave a Comment