ElasticSearch插入数据报错{"error":"Content-Type header [application/x-www-form-urlencoded] is not supporte

在使用XPUT往ElasticSearch插入数据事情,报错{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

ElasticSearch插入数据报错{

正确用法时:

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"指明头信息,具体介绍见官网介绍

你可能感兴趣的:(ElasticSearch,错误系列)