无法从空手道配置Content

编程入门 行业动态 更新时间:2024-10-07 02:30:07
本文介绍了无法从空手道配置Content-Type标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

am试图从空手道配置标头'Content-Type',但我无法这样做.我尝试了以下这些* configure标头= {'Content-Type':'application/json; charset = UTF-8'}和*标头Content-Type ='application/json; charset = UTF-8'.但是在发给我的帖子中,我总是得到Content-Type:text/plain这是错误的.有人可以帮忙吗?非常感谢!

am trying to configure the header 'Content-Type' from karate and I am not able to do so. I tried these * configure headers = {'Content-Type' : 'application/json;charset=UTF-8'} and * header Content-Type = 'application/json;charset=UTF-8'. But in the post call I am making , I always get Content-Type: text/plain which is wrong. Can anyone help? Thanks a lot!

推荐答案

实际上,没关系.我只是通过添加*标头Content-Type ='application/json'而不是Content-Type':'application/json **; charset = UTF-8而克服了这个问题.我删除了; charset = UTF-8.如果我添加它,它会中断.我收到错误java.lang.IllegalArgumentException:MIME类型可能不包含保留字符在org.apache.http.util.Args.check(Args.java:36).

Actually, never mind. I got over this by just adding * header Content-Type = 'application/json' rather than Content-Type' : 'application/json**;charset=UTF-8. I removed ;charset=UTF-8. If i add this, it breaks. I get an error java.lang.IllegalArgumentException: MIME type may not contain reserved characters at org.apache.http.util.Args.check(Args.java:36).

更多推荐

无法从空手道配置Content

本文发布于:2023-11-25 06:18:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628645.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:空手道   Content

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!