# URL search with query DSL body

**URL:** <https://discuss.elastic.co/t/url-search-with-query-dsl-body/132943>\
**Category:** Elasticsearch\
**Created:** [May 23, 2018, 8:11am UTC](https://discuss.elastic.co/t/url-search-with-query-dsl-body/132943 "2018-05-23T08:11:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gourmax](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gourmax](https://discuss.elastic.co/u/gourmax)\
**Post date:** [May 23, 2018, 8:11am UTC](https://discuss.elastic.co/t/url-search-with-query-dsl-body/132943/1 "2018-05-23T08:11:07Z")

</div>

I'm trying to use a browser to make a query using the JSON format (Query DSL) on it.  
The goal is to test the performance between both type of query format.

My query DSL is the following:

> GET /\_search  
> {  
> "query":  
> { "match": "flood" }  
> }

It's working perfeclty. Now I'm trying to do the same query using the JSON query DSL format on URL (cause my futur query will be more complex).

> [http://localhost:9200/\_search?source={"query"%3A%20{"match"%3A%20{"text"%3A"flood"}}}&source\_content\_type="application%2Fjson"](http://localhost:9200/_search?source=%7B%22query%22%3A%20%7B%22match%22%3A%20%7B%22text%22%3A%22flood%22%7D%7D%7D&source_content_type=%22application%2Fjson%22)

But when I do that, I encounter some problems and I cannot access to my results.

```
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"invalid Content-Type header [\"application/json\"]"}],"type":"illegal_argument_exception","reason":"invalid Content-Type header [\"application/json\"]"},"status":400}

```

Any idea ? my source body is a json format, I don't understand why I have this illegal\_argument\_exception.

---

<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:** [June 20, 2018, 8:11am UTC](https://discuss.elastic.co/t/url-search-with-query-dsl-body/132943/2 "2018-06-20T08:11:07Z")

</div>

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