POSTed key->value data cannot be recognized by application server

I am using latest version of Gatling 2. I tried to set the post parameter to to the request body with following code:

/request-bodies/post_params.txt

token=${token}&quantity=1&id=${id}

And in actual simulation, adding line below:

.body(ELFileBody("request-bodies/post_params.txt"))

I see that the data in the request body successfully but server can’t pick it up. What am I doing wrong?

Are you sure your server doesn’t require you to add the application/x-www-form-urlencoded Content-Type header?

Then, not really the easiest way to post params. This would be more simple IMHO:

.postParam(“token”, “${token}”)
.postParam(“quantity”, “1”)
.postParam(“id”, “${id}”)

Are you sure .postParam is supported? I get following compilation error:

value postParam is not a member of io.gatling.http.request.builder.HttpRequestWithParamsBuilder possible cause: maybe a semicolon is missing before `value postParam’?

Usage is:

.exec(http("/sign-in/")

.post("/sign-in")

.postParam(“token”,"${token}")

I am using latest version of Gatling. Am I missing something?

sorry, that’s formParam:
http://gatling.io/docs/2.0.0-RC3/http/http_request.html?highlight=formparam#post-parameters

That worked perfectly!! Thanks!