the following code snippet doesn't make sense to me.
curl -XGET 'localhost:9200/bank/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": { "match_phrase": { "address": "mill lane" } }
}
'
Does HTTP GET contain a body (data)?
No, GET
takes only a QUERY_STRING
, but no data.
Usually data are sent via POST
or PUT
HTTP verbs
Check http://www.restapitutorial.com/lessons/httpmethods.html
I found the answer here! In the ElasticSearch Docs.
https://www.elastic.co/guide/en/elasticsearch/guide/current/_empty_search.html
The HTTP libraries of certain languages (notably JavaScript) don’t allow GET requests to have a request body. In fact, some users are surprised that GET requests are ever allowed to have a body.
...