Gatling / Scala - Post Request: Set StringBody value from variable

I have the following chain:

        val search= exec(repeat(products.size, "n"){
            .uniformRandomSwitch( //5
                exec(session => {session.set("searchBody", """{"productId":"${productID}","minPrice":"${minPrice}"}""")}),
                exec(session => {session.set("searchBody", """{"productId":"${productID}","category":"${category}"}""")})
                .post(appURL + "/search")
                .check(, responseTimeInMillis.lessThan("${expectedResponseTime}"))

I want to set into the variable searchBody the value of the body of my requests. But when I execute the requests i am getting the error:

i.g.h.a.ResponseProcessor - Request '/products', but actually found 403

I think the error is how I am building the value of the body. The values of the variables are not printed in the string searchBody. Any idea?

may be helpful

在 2018年6月19日星期二 UTC+8上午6:38:06,roman…@gmail.com写道: