在使用XPUT往ElasticSearch插入数据事情,报错{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}
正确用法时:
curl -H "Content-Type: application/json" -XPUT 'http://192.168.177.11:9200/store/books/2' -d '{
"title": "Elasticsearch Blueprints",
"name" : {
"first" : "Vineeth",
"last" : "Mohan"
},
"publish_date":"2015-06-06",
"price":"35.99"
}'
需要添加-H "Content-Type: application/json"指明头信息,具体介绍见官网介绍
来源:CSDN
作者:LMRzero
链接:https://blog.csdn.net/qq_16669583/article/details/91380083