# Error in documentation: The Search API

**URL:** <https://discuss.elastic.co/t/error-in-documentation-the-search-api/135738>\
**Category:** Elasticsearch\
**Created:** [June 13, 2018, 1:39pm UTC](https://discuss.elastic.co/t/error-in-documentation-the-search-api/135738 "2018-06-13T13:39:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea.agnesse](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@andrea.agnesse](https://discuss.elastic.co/u/andrea.agnesse)\
**Post date:** [June 13, 2018, 1:39pm UTC](https://discuss.elastic.co/t/error-in-documentation-the-search-api/135738/1 "2018-06-13T13:39:13Z")

</div>

In new to Elastic Search, and I am following the online documentation.  
When introducing the [Search API](https://www.elastic.co/guide/en/elasticsearch/reference/current/_the_search_api.html) (and in the following pages), all the query with a body use the HTTP GET method; shouldn't it use the POST method?

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 13, 2018, 3:30pm UTC](https://discuss.elastic.co/t/error-in-documentation-the-search-api/135738/2 "2018-06-13T15:30:55Z")

</div>

HTTP RFC supports GET with body. So this is correct.  
We also support POST in such a case for some clients (like javascript) who does not support GET with body.

---

<div class="post-metadata">

**Author:** ![andrea.agnesse](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@andrea.agnesse](https://discuss.elastic.co/u/andrea.agnesse)\
**Post date:** [June 13, 2018, 3:58pm UTC](https://discuss.elastic.co/t/error-in-documentation-the-search-api/135738/3 "2018-06-13T15:58:50Z")

</div>

OK. I'm using bash+curl and it didn't work, I had to change from GET to POST.

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 13, 2018, 4:11pm UTC](https://discuss.elastic.co/t/error-in-documentation-the-search-api/135738/4 "2018-06-13T16:11:22Z")

</div>

bash+curl does work on my end.

---

<div class="post-metadata">

**Author:** ![andrea.agnesse](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@andrea.agnesse](https://discuss.elastic.co/u/andrea.agnesse)\
**Post date:** [June 14, 2018, 3:35pm UTC](https://discuss.elastic.co/t/error-in-documentation-the-search-api/135738/5 "2018-06-14T15:35:00Z")

</div>

You are right, Elasticsearch works with GET+body.

The strage thing is that curl on my machine do send a GET request with body, but ES does not reply. I managed to test it sending a hand-made request using Firefox developer tools (I had to use Wireshark to check if there was the body).

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 12, 2018, 3:35pm UTC](https://discuss.elastic.co/t/error-in-documentation-the-search-api/135738/6 "2018-07-12T15:35:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
