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"
}
問題解決~