I realise that I can save the response body in the virtual user's session:
val session: Session = Session("MySCN", "123")
val scn = scenario("MySCN")
.exec(http("my_request")
.post(serverURL)
.headers(headers)
.body(InputStreamBody(Helper.getByteArrayInputStream))
.check(status.is(200), bodyBytes.saveAs("responseBody")))
//key not found...
session("responseBody").as[ByteArray]
How can I read that responseBody from this (implicit?) Sesssion? I created an explicit Session as well...
Edit:
Based on the answer I have clarified my scenario. In the answer I do not know how the function transformBytes works.
Based on the answer form Stephane this is what worked for me:
So no explicit user session is required.