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


(Shrwan Kumar) #1

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


(Mark Walkom) #2

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


(Shrwan Kumar) #3

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