nybblesAndBits
nybblesAndBits

Reputation: 273

How can I send just 'application/json' as the content-type header with Karate?

I'm trying to write my first test for a service that I have no control over. The service validates headers on incoming requests and for the content-type header it requires that the value be application/json, and only that value. However when I try to write a test and explicitly set the content-type header to only have this value, the header that is generated has the following value instead: application/json; charset=UTF-8

This additional charset=UTF-8 value is preventing my test from passing. Is there anyway to prevent Karate from adding it?

Upvotes: 4

Views: 2590

Answers (1)

Babu Sekaran
Babu Sekaran

Reputation: 4239

The default setting of UTF-8 on Content-Type can be overide by this,

* configure charset = null

Please refer charset in configure table from karate documentation

Upvotes: 3

Related Questions