Custom SignatureCalculator - body of Request object passed is blank


I’m implementing a custom SignatureCalculator to generate a signature (similar to HMAC).

The problem I’ve encountered is that the request body is always null in the Request object which is passed to the calculateAndAddSignature method.

Has anyone come across this? I noticed that somebody did experience a similar problem over on the Play Framework group but no resolution was given there - so perhaps it’s a bug with AsyncHttpClient as opposed to Gatling? →

@ Stephane: Do you have any suggestions? Is this a bug? I can raise if so.

Cut-down calculateAndAddSignature function:

public void calculateAndAddSignature(Request request, RequestBuilderBase<?> requestBuilder) {

System.err.println("Body → " + request.getStringData());



Body → null

Thanks in advance,

Not a bug. Request has different fields for the different body formats. Depending on your use case, Gatling might not be using StringData but a different field.

Thanks for the swift response Stéphane.

If anyone else runs into this problem in future - here’s what I had to do:

In my request I was using a StringBody. This is a CompositeByteArrayBody (

In order to get the full request body to use in my SignatureCalculator, I had to use getCompositeByteData(), which returns a List<byte[]>. I needed to combine the items in this List to get the full body - like so: