title: gatling Form Parameters : How to pass custom form-data to post request
body: <p>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. </p>
  
  <p>EG : Print-Screen of the postman collection of the request body</p>
  
  <p><a href="https://i.stack.imgur.com/oMaid.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oMaid.png" alt="enter image description here"></a></p>
  
  <p>For that I have prepared a gatling code piece as below : </p>
  
  <pre><code>      .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") ----------&gt; Tried Method 1
        //.formParamSeq(Seq(("form_data", "datasource":"2__table")))  ----------&gt; Tried Method 2
        //.formParamMap(Map("form_data" -&gt;  "datasource":"2__table")) ----------&gt; Tried Method 3
        //.form("""form_data={"datasource":"2__table"}""") ----------&gt; Tried Method 4
  </code></pre>
  
  <p>Unfortunately gatling is not passing the form data as I want,currently how gatling pass the form data is :  </p>
  
  <p><code>form_data: {"datasource":"2__table"}</code></p>
  
  <p>The way I want to pass is : (Please note I have removed the ":" &amp; the following "space")</p>
  
  <p><code>form_data={"datasource":"2__table"}</code></p>
  
  <p>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 <code>form_data={"datasource":"2__table"}</code> ? </p>