Why am I unable to change Content-Type?


I have a strange issue where I try to set content type header to “text/xml; charset=utf-8” yet the requests are sent with “application/xml”

I tried adding header to the actual API call which looks like:

val getConfig: ChainBuilder = {
    .header("Content-Type", "text/xml; charset=utf-8")
    .check(status.in(200, 201,203,206,226,204,207,302)))

And also to my httpconf which looks like:

val soap_adapter_contentType: String = "text/xml; charset=utf-8"
val httpconf: HttpProtocolBuilder = http.baseUrl(Config.soap_adapter_url).header("Content-Type",soap_adapter_contentType)

Have you checked what asXml actually do?

Cant believe I missed that, thank you so much!

As you are already providing the headers

  .header("Content-Type", "text/xml; charset=utf-8")

try with removing .asXml