Could not resolve host: 'localhost是我在命令行中使用Curl往Kiabna中导入数据时报的错误。
首先,在Windows中curl命令后面用双引号;
其次,需要加-H "Content-Type: application/x-ndjson"
例如,原来的导入代码是:
curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json 则改成:
curl -H "Content-Type: application/x-ndjson" -XPOST "localhost:9200/bank/account/_bulk?pretty" --data-binary @accounts.json

本文介绍了解决在Windows环境下使用Curl命令向Kiabna导入数据时出现的'Couldnotresolvehost:'localhost'错误的方法。通过调整命令中的参数格式及添加正确的Content-Type头部信息,可以成功解决该问题。
1万+

被折叠的 条评论
为什么被折叠?



