# Why am I unable to change Content-Type?

**URL:** <https://community.gatling.io/t/why-am-i-unable-to-change-content-type/5648>\
**Category:** Gatling (Open-Source)\
**Created:** [June 2, 2020, 1:28pm UTC](https://community.gatling.io/t/why-am-i-unable-to-change-content-type/5648 "2020-06-02T13:28:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ito](https://avatars.discourse-cdn.com/v4/letter/i/ec9cab/32.png) [@Ito](https://community.gatling.io/u/Ito)\
**Post date:** [June 2, 2020, 1:28pm UTC](https://community.gatling.io/t/why-am-i-unable-to-change-content-type/5648/1 "2020-06-02T13:28:46Z")

</div>

Hi,

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:

```auto
val getConfig: ChainBuilder = {
  exec(http("Config")
    .post("url")
    .header("SOAPAction","value")
    .header("Content-Type", "text/xml; charset=utf-8")
    .body(ElFileBody("src/resources/xml/Config.xml")).asXml
    .check(status.in(200, 201,203,206,226,204,207,302)))
}

```

And also to my httpconf which looks like:

```auto
val soap_adapter_contentType: String = "text/xml; charset=utf-8"

```

```auto
val httpconf: HttpProtocolBuilder = http.baseUrl(Config.soap_adapter_url).header("Content-Type",soap_adapter_contentType)

```

```auto

```

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [June 2, 2020, 1:33pm UTC](https://community.gatling.io/t/why-am-i-unable-to-change-content-type/5648/2 "2020-06-02T13:33:32Z")

</div>

Have you checked what asXml actually do?  
[https://gatling.io/docs/current/http/http\_request/#headers](https://gatling.io/docs/current/http/http_request/#headers)

---

<div class="post-metadata">

**Author:** ![Ito](https://avatars.discourse-cdn.com/v4/letter/i/ec9cab/32.png) [@Ito](https://community.gatling.io/u/Ito)\
**Post date:** [June 2, 2020, 1:57pm UTC](https://community.gatling.io/t/why-am-i-unable-to-change-content-type/5648/3 "2020-06-02T13:57:41Z")

</div>

Cant believe I missed that, thank you so much!

---

<div class="post-metadata">

**Author:** ![ramanbatra](https://avatars.discourse-cdn.com/v4/letter/r/cab0a1/32.png) [@ramanbatra](https://community.gatling.io/u/ramanbatra)\
**Post date:** [June 2, 2020, 3:06pm UTC](https://community.gatling.io/t/why-am-i-unable-to-change-content-type/5648/4 "2020-06-02T15:06:28Z")

</div>

As you are already providing the headers

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

```

try with removing .asXml

```auto
body(ElFileBody("src/resources/xml/Config.xml"))

```
