空手道API测试-Content-Type为application/jwt时,API POST请求无法发送正文 [英] Karate API Tests - API POST request unable to send body when Content-Type is application/jwt

查看:153
本文介绍了空手道API测试-Content-Type为application/jwt时,API POST请求无法发送正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于主体为jwt空手道的POST api,无法发送内容类型为application/jwt的主体.

For POST api having body as jwt karate is unable to send body having content-type as application/jwt.

尽管我通过邮递员执行相同的操作,但它仍然有效.让我知道我是否想念任何东西.

Whereas while i perform the same through Postman it works. Let me know if i am missing anything.

我的API请求是:

1 > POST "Sever URL"
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Content-Length: 4959
1 > Content-Type: application/jwt
1 > Host: auth-sandbox.apiboitest.com
1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_144)

此处未传递已发送的正文: 给定URL DCRurl 和标题Content-Type ='application/jwt' 并请求payload_body_of_type_jwt 当方法POST

here the body is not getting passed which is been sent: Given url DCRurl And header Content-Type = 'application/jwt' And request payload_body_of_type_jwt When method POST

推荐答案

尝试以下操作:

  • 查看您是否缺少邮递员可能发送的Accept标头
  • 尝试在发出请求之前将request的值转换为字符串
  • 如果服务器未处理字符集,则
  • 请在发出请求之前尝试* configure charset = null,默认情况下,该字符集将作为UTF-8传递.
  • see if you are missing an Accept header that postman may be sending
  • try to convert the value of the request to string before making the request
  • try * configure charset = null before making the request if the server does not handle the charset, which is passed as UTF-8 by default

否则,没有足够的信息来说明您的问题出了什么问题.

Otherwise there is not enough info to tell what is wrong from your question.

这篇关于空手道API测试-Content-Type为application/jwt时,API POST请求无法发送正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆