json-rpc 2.0 request using gatling

With CURL I include this parameters to my request and it succeeds:

POST -d ‘{“jsonrpc”: “2.0”,“method”: “securelog”,“params”: {“data”:{“blob”:“TG9naGxvZ2ltaXNla3M=”,“x”:1,“z”:2}},“id”: 123456}’

I got confused, how can I provide the same parameters using gatling. So far I tried:

.formParam(“jsonrpc”, “2.0”)
.formParam(“method”, “securelog”)
.formParamMap(Map(“blob” → “someBlob”,
“x” → 1,
“y” → 2))
.multivaluedFormParam(“data”, session => List("${blob}", “${x}”, “${y}”))
.formParamMap(Map(“params” → “${data}”))
.formParam(“id”, 111111)


It obviously doesn’t work because those ${parameters} cannot be found. Looking through the documentation I didn’t find any information about forming a parameter inside other parameter. Is there a way?

What you tried with Gatling is simply not the same thing as your request with cURL.

{"jsonrpc": "2.0","method": "securelog","params": {"data":{"blob":"TG9naGxvZ2ltaXNla3M=","x":1,"z":2}},"id": 123456}

is not a list of form params, it’s a request body.



So simple. Thank you very much. I added .body(StringBody(…)) and now everything is ok.