elasticsearch6.x {"error":"Content-Type header [application/x-www-form-urlencoded] is not support

问题:elasticsearch6.x {“error”:”Content-Type header [application/x-www-form-urlencoded] is not supported”

描述:

curl -XPOST 192.168.14.173:32000/test_index_1221/test_type/5 -d '{'user_name':"xiaoming"}'
{
"error":"Content-Type header [application/x-www-form-urlencoded] is not supported",
"status":406 
}

 

官方改变:https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests

解决方法:

curl -H "Content-Type: application/json" -XPOST 192.168.14.173:32000/test_index_1221/test_type/5 -d '{'user_name':"xiaoming"}'

 



posted @ 2019-12-13 15:13  门罗的魔术师  阅读(494)  评论(0编辑  收藏  举报