I have a heterogenous collections of resources on which I need to support multiple search criteria. Since there is a limit on the URL using the query string, I was thinking of implementing this using HTTP POST instead of GET
Hence instead of
HTTP GET /states/, HTTP GET /cities, HTTP GET /localities
I was thinking of implementing this as
HTTP POST /searchengine with the body as
{
"state" : "xxx",
"city": "yyy"
"locality", "zzz"
}
and return the result in response to the HTTP POST
My question is therefore if POST instead of GET is acceptable as RESTful?
And if search results can be sent in response to HTTP POST (with HTTP 200) or should the search results be indicated by the Location header (and with HTTP 3xx)?