# Http GET without BODY

**URL:** <https://discuss.elastic.co/t/http-get-without-body/12302>\
**Category:** Elasticsearch\
**Created:** [June 6, 2013, 5:56pm UTC](https://discuss.elastic.co/t/http-get-without-body/12302 "2013-06-06T17:56:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igal/32/1119_2.png) [@Igal](https://discuss.elastic.co/u/Igal)\
**Post date:** [June 6, 2013, 5:56pm UTC](https://discuss.elastic.co/t/http-get-without-body/12302/1 "2013-06-06T17:56:45Z")

</div>

hi everyone --

after watching this bonsai-cool project for a while I am finally ready to  
start using it.

my http client does not support BODY in GET requests, so following the  
comment in [http://www.elasticsearch.org/guide/reference/api/](http://www.elasticsearch.org/guide/reference/api/) that suggested  
using a query string parameter named "source" instead.

I added 5 test documents with the following information:

{ "name" : "Shay Banon", "org" : "Elastic Search" }  
{ "name" : "Michael Offner", "org" : "Railo" }  
{ "name" : "Igal Sapir", "org" : "Railo" }  
{ "name" : "Uwe Schindler", "org" : "Lucene Search" }  
{ "name" : "Michael McCandless", "org" : "Lucene Search" }

now if I execute the following GET request:

[http://localhost:9200/index/type/\_search?q=Search](http://localhost:9200/index/type/_search?q=Search)

I get the correct results, which are the 3 documents with the word "Search"

but I can not produce the same results with the "source" param.

what would be the SOURCE equivalent to "q=Search"?

thanks,

Igal

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![mattweber](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattweber/32/44940_2.png) [@mattweber](https://discuss.elastic.co/u/mattweber)\
**Post date:** [June 6, 2013, 6:06pm UTC](https://discuss.elastic.co/t/http-get-without-body/12302/2 "2013-06-06T18:06:14Z")

</div>

Most http clients do not support GET requests with a body which is why ES  
also supports executing searches using a POST or the source parameter as  
you mention. Using POST is going to be the best approach if possible. At  
any rate, the body equivalent of using the q parameter is:

{"query":{"query\_string":{"query":"Search"}}}

Thanks,  
Matt Weber

On Thu, Jun 6, 2013 at 10:56 AM, Igal [igal@getrailo.org](mailto:igal@getrailo.org) wrote:

> hi everyone --
> 
> after watching this bonsai-cool project for a while I am finally ready to  
> start using it.
> 
> my http client does not support BODY in GET requests, so following the  
> comment in [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/) that  
> suggested using a query string parameter named "source" instead.
> 
> I added 5 test documents with the following information:
> 
> { "name" : "Shay Banon", "org" : "Elastic Search" }  
> { "name" : "Michael Offner", "org" : "Railo" }  
> { "name" : "Igal Sapir", "org" : "Railo" }  
> { "name" : "Uwe Schindler", "org" : "Lucene Search" }  
> { "name" : "Michael McCandless", "org" : "Lucene Search" }
> 
> now if I execute the following GET request:
> 
> [http://localhost:9200/index/type/\_search?q=Search](http://localhost:9200/index/type/_search?q=Search)
> 
> I get the correct results, which are the 3 documents with the word "Search"
> 
> but I can not produce the same results with the "source" param.
> 
> what would be the SOURCE equivalent to "q=Search"?
> 
> thanks,
> 
> Igal
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Igal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igal/32/1119_2.png) [@Igal](https://discuss.elastic.co/u/Igal)\
**Post date:** [June 6, 2013, 10:31pm UTC](https://discuss.elastic.co/t/http-get-without-body/12302/3 "2013-06-06T22:31:35Z")

</div>

Thanks Matt 🙂

On 6/6/2013 11:06 AM, Matt Weber wrote:

> Most http clients do not support GET requests with a body which is why  
> ES also supports executing searches using a POST or the source  
> parameter as you mention. Using POST is going to be the best approach  
> if possible. At any rate, the body equivalent of using the q  
> parameter is:
> 
> {"query":{"query\_string":{"query":"Search"}}}
> 
> Thanks,  
> Matt Weber
> 
> On Thu, Jun 6, 2013 at 10:56 AM, Igal \<[igal@getrailo.org](mailto:igal@getrailo.org)  
> [mailto:igal@getrailo.org](mailto:igal@getrailo.org)\> wrote:
> 
> ```
> hi everyone --
> 
> after watching this bonsai-cool project for a while I am finally
> ready to start using it.
> 
> my http client does not support BODY in GET requests, so following
> the comment in
> http://www.elasticsearch.org/guide/reference/api/ that suggested
> using a query string parameter named "source" instead.
> 
> I added 5 test documents with the following information:
> 
> { "name" : "Shay Banon", "org" : "Elastic Search" }
> { "name" : "Michael Offner", "org" : "Railo" }
> { "name" : "Igal Sapir", "org" : "Railo" }
> { "name" : "Uwe Schindler", "org" : "Lucene Search" }
> { "name" : "Michael McCandless", "org" : "Lucene Search" }
> 
> now if I execute the following GET request:
> 
> http://localhost:9200/index/type/_search?q=Search
> 
> I get the correct results, which are the 3 documents with the word
> "Search"
> 
> but I can not produce the same results with the "source" param.
> 
> what would be the SOURCE equivalent to "q=Search"?
> 
> thanks,
> 
> Igal
> -- 
> You received this message because you are subscribed to the Google
> Groups "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to elasticsearch+unsubscribe@googlegroups.com
> <mailto:elasticsearch%2Bunsubscribe@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> ```
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/BY2Hf-mgL3E/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/BY2Hf-mgL3E/unsubscribe?hl=en-US).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Igal Sapir  
Railo Core Developer

> **[Top 10 Best Bitcoin Slots Sites | Best Online Casino 2023](https://www.getrailo.org/)**
>
> Compare the Best Bitcoin Slots Sites now at getrailo.org. Slots represent some of the most popular and exciting online casino offerings.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:32am UTC](https://discuss.elastic.co/t/http-get-without-body/12302/4 "2017-07-06T02:32:30Z")

</div>


