I am new to gatling scripting. I am trying to execute a performance testing against one of our application's POST api. This POST request API required to pass the form-data.
EG : Print-Screen of the postman collection of the request body
For that I have prepared a gatling code piece as below :
.exec(http("POST Explore JSON")
.post("/sunrise/explore_json/")
.header("Content-Type", "application/x-www-form-urlencoded")
.header("Referer", "https://example.com/sunrise/dashboard/dummy_dashboard/")
.header("x-csrftoken", "${csrf_token1}")
.queryParam("form_data","{\"slice_id\":4}")
//.formParam("form_data","datasource":"2__table") ----------> Tried Method 1
//.formParamSeq(Seq(("form_data", "datasource":"2__table"))) ----------> Tried Method 2
//.formParamMap(Map("form_data" -> "datasource":"2__table")) ----------> Tried Method 3
//.form("""form_data={"datasource":"2__table"}""") ----------> Tried Method 4
Unfortunately gatling is not passing the form data as I want,currently how gatling pass the form data is :
form_data: {"datasource":"2__table"}
The way I want to pass is : (Please note I have removed the ":" & the following "space")
form_data={"datasource":"2__table"}
I have tried many many ways, but I could not successfully pass form data as above
Is there any way that I can pass as form_data={"datasource":"2__table"}
?
key: value
). Can you check the console on your Postman to verify that it's being sent askey=value
? – ramdesh