Another option is to use PUT/POST to create a query resource that you then refer to in your GET request. It can be useful if you want to refer to it and the server can use the information eg to cache the complex query.
That’s technically true, but performance-wise I’m not realistically going to submit two separate requests for what is semantically one action. On the other hand, it makes the query resource reusable for saved searches, and for showing search history.
It is not much different from a prepared statement or a stored query, indeed it can even be parameterized. With keepalive two requests is not so bad.
And then you need to store the queries in a database. Make sure we flush them out 'some time'. What happens when a client tries to use a flushed query? Something that previously works now no longer does.
Or, lets just use POST.
it would also require a long poll, but is definitely useful for certain situations where a synchronous operation would take too long.