美好的一天!在我的否定测试用例中,我必须放置一个没有Content-Type头的请求,以匹配所需的4xx状态代码.问题是空手道会自动设置适当的Content-Type. 例如.当我通过{}作为请求时,它设置了application/json;字符集= UTF-8 当我按要求传递``时,它将设置文本/纯文本; charset = UTF-8
Good day! In my negative test cases I have to PUT a request without Content-Type header in order to match desired 4xx status code. The problem is karate automatically sets an appropriate Content-Type. E.g. when I pass {} as request it sets application/json; charset=UTF-8 when I pass '' as request it sets text/plain; charset=UTF-8
问题是如何在没有Content-Type标头的情况下发送PUT请求?
The question is how can I send a PUT request without a Content-Type header?
推荐答案只需设置* configure charset = null:
这里是文档: github/intuit/karate#configure
有关详细示例,请参见: content-type.feature
For a detailed example, see: content-type.feature
更多推荐
空手道会自动设置Content
发布评论