ElasticSearch搭建完成後準備使用es-head建立索引時發現Content-Type錯誤了
看一下網絡流可知報406 錯誤
{
"error" : "Content-Type header [application/x-www-form-urlencoded] is not supported",
"status" : 406
}
解決辦法
進入head插件安裝目錄
- 第6886行
改為 /contentType: "application/x-www-form-urlencoded
contentType: "application/json;charset=UTF-8"
- 第7574行
改為 var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
var inspectData = s.contentType === "application/json;charset=UTF-8" &&