elasticsearch错题集

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

curl -X PUT 'localhost:9200/accounts/person/1' -d '
{
  "user": "张三",
  "title": "工程师",
  "desc": "数据库管理"
}'

{"error":"Content-Type header [application/json-X] is not supported","status":406}%

解决办法:

curl -H "Content-Type: application/json" -X PUT 'localhost:9200/accounts/person/1' -d '
{
  "user": "张三",
  "title": "工程师",
  "desc": "数据库管理"
}'

curl -H “Content-Type: application/json” -X POST ‘localhost:9200/accounts/person’ -d ‘
{
“user”: “李四”,
“title”: “工程师”,
“desc”: “系统管理”
}’


文章作者: 凌云
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 凌云 !
  目录