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

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
using curl command

curl -XPUT 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

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

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

1 Like

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 -d @mapping.json

Thanks

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