【问题标题】:Content-Type header [application/x-www-form-urlencoded] is not support error when import json data into elastic将 json 数据导入弹性时,Content-Type 标头 [application/x-www-form-urlencoded] 不支持错误
【发布时间】:2018-09-05 04:53:30
【问题描述】:

下面是我的代码

curl -XPOST "http://localhost:9200/test/p
ost/_bulk/"  -d @City_collection.json

错误: {"error":"Content-Type 标头 [application/x-www-form-urlencoded] 不支持 ed","status":406}

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    你需要像这样指定内容类型标题

    curl -XPOST "http://localhost:9200/test/post/_bulk/" -H "Content-Type: application/json" -d @City_collection.json
                                                                    ^
                                                                    |
                                                                add this
    

    【讨论】:

    • 我已经更新了我的答案,使用双引号而不是单引号,因为你在 Windows 上
    • 感谢您的回答 Val ..但是在我的系统中,将大型 json 文件导入弹性文件时仍然出现错误..我不知道该怎么做...
    • 很高兴我们解决了内容类型标头问题。随意创建一个带有您遇到的特定错误的新问题。并显示您尝试上传的 JSON 文件的一部分。
    猜你喜欢
    • 2019-05-24
    • 2018-05-12
    • 2018-06-20
    • 2018-12-27
    • 1970-01-01
    • 2019-10-26
    • 2019-02-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多