by amdelamar · 4y ago · 0 comments
GET /api/query
Host: example.org
Content-Type: application/json
{
"a": "valueWith$pecialChars",
"b": "valueWith$pecialChars",
"limit": 100
}
It worked fine for him because he used curl, which allows GET with a body. But I was using Paw (similar to Postman) which refused to send it. I mentioned the issue to him to which the reply was along the lines of "its a non issue, just use curl". I kid you not, 1 week after this coworker left for another job I fixed the service to accept POST requests.If QUERY was around I'm sure I could've made a stronger case to fix it sooner.
Elasticsearch also encourages GET with body. But a request payload is undefined, according to the RFC:
A payload within a GET request message has no defined semantics;
sending a payload body on a GET request might cause some existing
implementations to reject the request.