[ElasticSearch] PUT、POSTする際にエラー(error : Content-Type header [application/x-www ~~~)


PUT、POSTする際のエラー


"error" : "Content-Type header [application/x-www ~~~ "


調べたところ、バージョン6 以降からはheadの値を詳細に記載しないと発生するエラーだそうです。そのため、IndexやDocumentの作成の際に下記のようにheadの値を追加しないといけないです。


#curl -H 'Content-Type:application/json' -XPOST [elasticsearchアドレス]/~~ 



댓글