# (C#) NEST search using GET instead of POST?

**URL:** <https://discuss.elastic.co/t/c-nest-search-using-get-instead-of-post/24128>\
**Category:** Elasticsearch\
**Created:** [June 22, 2015, 8:45pm UTC](https://discuss.elastic.co/t/c-nest-search-using-get-instead-of-post/24128 "2015-06-22T20:45:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neverwhere](https://avatars.discourse-cdn.com/v4/letter/n/7bcc69/32.png) [@Neverwhere](https://discuss.elastic.co/u/Neverwhere)\
**Post date:** [June 22, 2015, 8:45pm UTC](https://discuss.elastic.co/t/c-nest-search-using-get-instead-of-post/24128/1 "2015-06-22T20:45:45Z")

</div>

Hi,

I'm wondering if someone knows how to make the ElasticSearch C# package (NEST) use the HTTP GET method instead of HTTP POST or if someone can point me in that direction.

I see from the source code that I need to somehow define a "source" on the QueryString, but I am unsure how to do so.

Basically I'm looking to end up with a search URI similar to:

```
https://myip.com/elasticsearch/index/event/_search?pretty&source={"from":0,"size":15,"query":{"query_string":{"query":"id:1000100721495"}},"filter":{"range":{"timestamp":{"lte":"2016-06-22T23:59:00.000","gte":"2015-06-10T00:00:00.000"}}}}

```

The above looks like this after being sent via the default POST method using NEST:

```
https://myip.com/elasticsearch/index/event/_search?pretty=true

{
  "from": 0,
  "size": 15,
  "query": {
    "query_string": {
      "query": "1000100721495",
      "fields": [
        "id"
      ]
    }
  },
  "filter": {
    "range": {
      "timestamp": {
        "lte": "2016-06-12T23:59:00.000",
        "gte": "2015-06-10T00:00:00.000"
      }
    }
  }
}

```

Is this even possible using NEST?

Thanks!

---

<div class="post-metadata">

**Author:** ![mosiddi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mosiddi/32/577_2.png) [@mosiddi](https://discuss.elastic.co/u/mosiddi)\
**Post date:** [September 16, 2015, 7:24am UTC](https://discuss.elastic.co/t/c-nest-search-using-get-instead-of-post/24128/2 "2015-09-16T07:24:45Z")

</div>

did you read this: [http://nest.azurewebsites.net/nest/search/basics.html](http://nest.azurewebsites.net/nest/search/basics.html)

---

<div class="post-metadata">

**Author:** ![Neverwhere](https://avatars.discourse-cdn.com/v4/letter/n/7bcc69/32.png) [@Neverwhere](https://discuss.elastic.co/u/Neverwhere)\
**Post date:** [September 18, 2015, 2:48pm UTC](https://discuss.elastic.co/t/c-nest-search-using-get-instead-of-post/24128/3 "2015-09-18T14:48:19Z")

</div>

I did, however it doesn't mention that due to restrictions with how .NET operates all calls to the search method(s) will be done via POST instead of GET.

I did find a way around it but the method for doing so isn't listed within the documentation. I'm using the `_source` option for searching, but as a result of that I can no longer use NEST.

---

<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 5, 2017, 11:49pm UTC](https://discuss.elastic.co/t/c-nest-search-using-get-instead-of-post/24128/4 "2017-07-05T23:49:26Z")

</div>


