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”: “系统管理”
}’