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

**URL:** <https://discuss.elastic.co/t/error-content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/164059>\
**Category:** Elasticsearch\
**Created:** [January 13, 2019, 10:15pm UTC](https://discuss.elastic.co/t/error-content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/164059 "2019-01-13T22:15:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrwan](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shrwan](https://discuss.elastic.co/u/shrwan)\
**Post date:** [January 13, 2019, 10:15pm UTC](https://discuss.elastic.co/t/error-content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/164059/1 "2019-01-13T22:15:22Z")

</div>

Hi Friends,  
I am new to elastic search and looking for lep!  
I am trying to create mapping , buy using the same JSON at URL [https://www.elastic.co/blog/analyzing-network-packets-with-wireshark-elasticsearch-and-kibana](https://www.elastic.co/blog/analyzing-network-packets-with-wireshark-elasticsearch-and-kibana)  
using curl command

curl -XPUT [https://xxx.us-east-1.es.amazonaws.com/ciscofeed/packets/\_mapping](https://xxx.us-east-1.es.amazonaws.com/ciscofeed/packets/_mapping) -d @mapping.json

but it is throwing below exception

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

My Index url [https://xxxxxx.us-east-1.es.amazonaws.com/ciscofeed?pretty](https://xxxxxx.us-east-1.es.amazonaws.com/ciscofeed?pretty)

Out of above curl command  
{  
"ciscofeed" : {  
"aliases" : { },  
"mappings" : { },  
"settings" : {  
"index" : {  
"creation\_date" : "1547416048805",  
"number\_of\_shards" : "5",  
"number\_of\_replicas" : "1",  
"uuid" : "7nrSmfnqR\_mKhdfUxUYZ4g",  
"version" : {  
"created" : "6030199"  
},  
"provided\_name" : "ciscofeed"  
}  
}  
}  
}

Thanks  
Shrwan

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 13, 2019, 10:19pm UTC](https://discuss.elastic.co/t/error-content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/164059/2 "2019-01-13T22:19:14Z")

</div>

Try adding `-H'Content-Type: application/json'`.

> **[Strict Content-Type Checking for Elasticsearch REST Requests
	  	 | Elastic](https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests)**
>
> Elasticsearch 6.0 will enforce strict content-type checking. All REST requests that include a body must also provide the correct Content-Type header.

---

<div class="post-metadata">

**Author:** ![shrwan](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shrwan](https://discuss.elastic.co/u/shrwan)\
**Post date:** [January 14, 2019, 6:44am UTC](https://discuss.elastic.co/t/error-content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/164059/3 "2019-01-14T06:44:38Z")

</div>

Thanks you warklm, Now i am getting below error

{"error":{"root\_cause":[{"type":"not\_x\_content\_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}],"type":"not\_x\_content\_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"},"status":500}

Curl command : curl -H "Content-Type: application/json" -XPUT [https://search-cisco-xxxxxxx.us-east-1.es.amazonaws.com/ciscofeed/packets/\_mapping](https://search-cisco-xxxxxxx.us-east-1.es.amazonaws.com/ciscofeed/packets/_mapping) -d @mapping.json

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:** [February 11, 2019, 6:44am UTC](https://discuss.elastic.co/t/error-content-type-header-application-x-www-form-urlencoded-is-not-supported-status-406/164059/4 "2019-02-11T06:44:38Z")

</div>

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