Issue with passing request headers

Hi Team,

I recently started implementing performance testing with Gatling and I think I may have identified a bug.

Below is a code snippet of a sample POST request I’m trying to simulate.

Method calling basic order request:

public static HttpRequestActionBuilder orderEndpointRequest() {
       return http("Sending order - /order post ").post("/order")
                .header("content-type", "application/json")
                .header("Origin", "http://XXXXXXXXXX")
                .header("Referer", "http://XXXXXXXXX")
                .body(StringBody(orderRequestMap(orderID, amount, description)))

ScenarioBuilder request

private final ScenarioBuilder sendOrderRequest = scenario(" Order Request")
            .exec(session -> {
                System.out.println( "This is the content type: " + session.getString("content"));
                System.out.println( "This is the referer: " + session.getString("referer"));
                System.out.println( "This is the origin: " + session.getString("origin"));
                return session;


The output is as follows:

This is the content type: application/json;charset=UTF-8
This is the referer: null
This is the origin: null

The issue I’m seeing is for the following referrers origin and header why are they showing up as null?, despite passing them in orderEndpointRequest method. Is this a bug or am I doing something wrong?

A version of gatling I have in pom.xml


Are you sure that your request succeeds (no IO exception, 200 response status)?

Yes, this is my console output

2023-11-13 10:49:10 0s elapsed
---- Requests ------------------------------------------------------------------

Global (OK=0 KO=1 )
Sending order - /order post (OK=0 KO=1 )
---- Errors --------------------------------------------------------------------
header(Referer).find.exists, found nothing 1 (100.0%)

Referer and Origin are request headers, not response ones. header checks are applied on the response headers. These 2 checks can’t possibly work.

okay, that makes sense, thanks for the clarification. This issue can be closed off :slightly_smiling_face: