The elasticsearch examples all use -d, with the JSON in a string. But, the
man page for CURL states that -d "sends the specified data in a POST
request": http://unixhelp.ed.ac.uk/CGI/man-cgi?curl
So, it appears the use of -d isn't compliant with the spec for CURL.
Am I missing something here?
Whilst exploring the ES REST-API, is there a tidy way of collating a query
as JSON and then passing that into the GET?
Personally, I disagree with the GET-can't-contain-a-body argument,
because the query string has a limited length. Conceptually, a search
is a GET, not a POST.
Javascript doesn't support it, but most other HTTP libraries do.
The elasticsearch examples all use -d, with the JSON in a string.
But, the man page for CURL states that -d "sends the specified data
in a POST request": http://unixhelp.ed.ac.uk/CGI/man-cgi?curl
So, it appears the use of -d isn't compliant with the spec for CURL.
It defaults to a POST, but you can specify whichever method you want
with -X
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.