2017-11-29 12 views
9

以前はElasticSearch 5.2を使用していましたが、6.0にアップグレードしました。ElasticSearch - Content-Typeヘッダー[application/x-www-form-urlencoded]はサポートされていません

私はガイドhere次のインデックステンプレートを作成しようとしていますが、エラー

Content-Type header [application/x-www-form-urlencoded] is not supported 

が私のクエリはこの問題を解決するには

curl -X PUT localhost:9200/_template/template_1 -d ' 
{ 
    "index_patterns": ["te*", "bar*"], 
    "mappings": { 
    "type1": { 
     "properties": { 
     "host_name": { 
      "type": "keyword" 
     } 
     } 
    } 
    } 
}' 

答えて

22

、カールオプションを追加-H 'Content-Type: application/json'


ありました

このエラーはstrictのためですElasticsearch 6.0、体はまた、その身体の正しいコンテンツタイプを提供する必要があります含めるすべてのREST要求から出発しthis post

で説明したように、コンテンツタイプは、ElasticSearch 6.0で導入されたをチェックします。

関連する問題