Karate API Tests - API POST request unable to send body when Content-Type is application/jwt

ⅰ亾dé卋堺 提交于 2019-12-11 11:46:43

问题


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.

My API request is:

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)

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


回答1:


Try the following:

  • 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.



来源:https://stackoverflow.com/questions/54109901/karate-api-tests-api-post-request-unable-to-send-body-when-content-type-is-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!