Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Karate automatically sets Content-Type header [duplicate]

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

The question is how can I send a PUT request without a Content-Type header?

like image 698
firstName lastName Avatar asked Sep 02 '25 08:09

firstName lastName


1 Answers

Just set * configure charset = null:

Here is the documentation: https://github.com/intuit/karate#configure

For a detailed example, see: content-type.feature

like image 149
Peter Thomas Avatar answered Sep 04 '25 23:09

Peter Thomas