I have a simple POST request that requires a json Content-Type header and a body like
{
oneNbr: \"2016004444\",
twoCode: \"@@@\",
threeNbr: \"STD PA
We did some debugging and found that Karate automatically appends 'charset=UTF-8' to the Content-Type header. The API does not expect charset.
Found the following post and that solved the problem:
How can I send just 'application/json' as the content-type header with Karate?
Posting this to help others in future.
It's simple. Try to use this in your background.
* def charset = null
Try adding a * header Accept = 'application/json'
header. The one difference between Karate and Postman is that Postman tries to be smart and auto-adds an Accept
header - whereas Karate does not.