I'm using Gatling to measure performance for some legacy applications. Gatling allows users to configure HTTP requests, and it allows re-using pieces of the configuration on different requests. To do this, it will remove pieces of the HTTP configuration from requests where they are not relevant. For example, it removes the content-type header from GET requests.
That's where my problem comes in – one of the legacy applications I want to test requires all requests, regardless of method. It returns 415 if I make a request without the content-type header. Is there any way to force Gatling to send that header on a request where it shouldn’t apply?
I tried all variations of content-type, both using the built in variable and the string. I also tried using the accept header instead. I tried attaching the header directly to the HTTP object (ie http("foo").get("bar").header("content-type", "application/json"). The header is still omitted from the actual request Gatling sends.
Are there any way to force o use the content-type header?
You're probably bitten by a regression introduced in Gatling 3.10. We're going to release Gatling 3.10.4 with the fix beginning of next week. Until then, please downgrade to Gatling 3.9.6.
Regards