# Content-Type header \[application/x-www-form-urlencoded\] is not supported, "status":406

**URL:** <https://discuss.elastic.co/t/content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/229528>\
**Category:** Elasticsearch\
**Created:** [April 23, 2020, 6:38pm UTC](https://discuss.elastic.co/t/content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/229528 "2020-04-23T18:38:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielSTO](https://avatars.discourse-cdn.com/v4/letter/d/e480ec/32.png) [@DanielSTO](https://discuss.elastic.co/u/DanielSTO)\
**Post date:** [April 23, 2020, 6:38pm UTC](https://discuss.elastic.co/t/content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/229528/1 "2020-04-23T18:38:17Z")

</div>

Hello!  
I am trying to run a simple query that I have copied as a curl from kibana and I am Trying to run it on my windows comand line. My curl is:  
`curl -XGET "http://localhost:9200/inspections/_doc/_search" -H 'Content-Type: application/json' -d'{ "query": { "match": { "business_name": "soup" } }}'`  
and I am getting this error:  
`"error":"Content-Type header [application/x-www-form-urlencoded] is not supported"`

Any help would be appreciated

---

<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:** [April 24, 2020, 2:40am UTC](https://discuss.elastic.co/t/content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/229528/2 "2020-04-24T02:40:40Z")

</div>

Welcome!

I believe it's a problem with curl on windows. I always found it painful.  
I'd recommend using Kibana Dev Console or any REST console you could have in your browser instead.

---

<div class="post-metadata">

**Author:** ![DanielSTO](https://avatars.discourse-cdn.com/v4/letter/d/e480ec/32.png) [@DanielSTO](https://discuss.elastic.co/u/DanielSTO)\
**Post date:** [April 24, 2020, 4:56pm UTC](https://discuss.elastic.co/t/content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/229528/3 "2020-04-24T16:56:53Z")

</div>

I am really greatfull with your reply.  
I thought something was wrong with my ES. So, I will continue using kibana.

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [April 27, 2020, 12:00am UTC](https://discuss.elastic.co/t/content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/229528/4 "2020-04-27T00:00:23Z")

</div>

If you're running on Windows with at least PowerShell 3.0+, you can always give the [`Elastic.Console`](https://github.com/elastic/powershell/tree/master/Elastic.Console) PowerShell module a try. It provides a _curl_-like experience in PowerShell with API path and method completion

To [install in PowerShell from the PowerShell gallery](https://www.powershellgallery.com/packages/Elastic.Console/7.6.0-rc1)

```auto
Install-Module Elastic.Console -AllowPrerelease

```

Upon installation, the module will be configured with the APIs matching the version returned from

```auto
Get-ElasticsearchVersion

```

If you want to run with a different version of APIs, you can set this with

```auto
Set-ElasticsearchVersion 7.6.2

```

If not already downloaded, this will download the REST API specs of 7.6.2 version, which are used to power autocompletion.

Then, to make an API call

```auto
Invoke-Elasticsearch http://localhost:9200/inspections/_doc/_search -Body @'
{ "query": { "match": { "business_name": "soup" } }}
'@

```

`es` is an alias for `Invoke-Elasticsearch`, and `http://localhost:9200` is the default protocol, host and port, so this can be shortened to

```auto
es inspections/_doc/_search -Body @'
{ "query": { "match": { "business_name": "soup" } }}
'@

```

---

<div class="post-metadata">

**Author:** ![syPY45Xb5n7S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sypy45xb5n7s/32/68147_2.png) [@syPY45Xb5n7S](https://discuss.elastic.co/u/syPY45Xb5n7S)\
**Post date:** [May 12, 2020, 11:17am UTC](https://discuss.elastic.co/t/content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/229528/5 "2020-05-12T11:17:36Z")

</div>

I'd use PowerShell's Invoke-WebRequest/Invoke-RestMethod instead., which should be something like this:

```
Invoke-WebRequest -Uri "http://localhost:9200/inspections/_doc/_search" -UseBasicParsing -ContentType 'application/json' -Method Get -Body '{ "query": { "match": { "business_name": "soup" } }}'
```

---

<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 9, 2020, 11:17am UTC](https://discuss.elastic.co/t/content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/229528/6 "2020-06-09T11:17:44Z")

</div>

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