欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

elasticsearch6.x {error:Content-Type header [application/x-www-form-urlencoded] is not supported

发布时间:2024/9/20 编程问答 30 豆豆
生活随笔 收集整理的这篇文章主要介绍了 elasticsearch6.x {error:Content-Type header [application/x-www-form-urlencoded] is not supported 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/dtiove/article/details/78870607
问题描述

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}

    1
    2

官方解释:
官方改变
解决方法

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}

    1
    2

指定header头即可
---------------------
作者:dtiove
来源:CSDN
原文:https://blog.csdn.net/dtiove/article/details/78870607
版权声明:本文为博主原创文章,转载请附上博文链接!

总结

以上是生活随笔为你收集整理的elasticsearch6.x {error:Content-Type header [application/x-www-form-urlencoded] is not supported的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。