No.1
环境CentOS7 64bit
初次安装Elasticsearch以后,按照教程指导,在操作:
curl -XPUT 'localhost:9200/customer/external/1?pretty' -d '
{
"name": "Jimmy Yankee"
}'
(Customer是之前添加的索引)
提示报错,如下:
{
"error" : "Content-Type header [application/x-www-form-urlencoded] is not supported",
"status" : 406
}
解决方案:
在原指令中,添加:-H 'Content-Type: application/json'
既:
curl -XPUT 'localhost:9200/customer/external/1?pretty' -H 'Content-Type: application/json' -d '
{
"name": "Jimmy Yankee"
}
问题解决~