首页 > 其他 > 详细

elasticsearch6.x {"error":"Content-Type header [ap

时间:2018-11-19 12:27:17      阅读:344      评论:0      收藏:0      [点我收藏+]
问题描述

curl -XPOST 192.168.14.173:32000/test_index_1221/test_type/5 -d ‘{‘user_name‘:"xiaoming"}‘
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

官方解释: https://www.elastic.co/cn/blog/strict-content-type-checking-for-elasticsearch-rest-requests
解决方法

curl -H "Content-Type: application/json" -XPOST 192.168.14.173:32000/test_index_1221/test_type/5 -d ‘{‘user_name‘:"xiaoming"}‘
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

指定head头

elasticsearch6.x {"error":"Content-Type header [ap

原文:http://blog.51cto.com/461205160/2318702

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!