# How  to send form-data in post request

**URL:** <https://community.gatling.io/t/how-to-send-form-data-in-post-request/6313>\
**Category:** Gatling (Open-Source)\
**Created:** [November 16, 2021, 5:39pm UTC](https://community.gatling.io/t/how-to-send-form-data-in-post-request/6313 "2021-11-16T17:39:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghazouani\_nada](https://avatars.discourse-cdn.com/v4/letter/g/c37758/32.png) [@ghazouani\_nada](https://community.gatling.io/u/ghazouani_nada)\
**Post date:** [November 16, 2021, 5:39pm UTC](https://community.gatling.io/t/how-to-send-form-data-in-post-request/6313/1 "2021-11-16T17:39:42Z")

</div>

Hello,  
I have a post request, the body is of type **form-data**

 ![form-data body.PNG](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/1X/cdcd59b2722e6bf1ed0639f6d283341038d79706.png)  
I try to do it with :  
**.queryParam(“texte”, “test”)**  
**.queryParam(“ticket”, “2”)**  
**.queryParam(“createur”, “51095”)**

And then with:  
**.body(StringBody(**  
**"""{**  
**| “texte”: “test”,**  
**| “ticket”: “2”,**  
**| “createur”: "53470"**  
**|}""".stripMargin))**

But it doesn’t work, how to do this with gatling and how to upload images ?  
I need help please

---

<div class="post-metadata">

**Author:** ![ghazouani\_nada](https://avatars.discourse-cdn.com/v4/letter/g/c37758/32.png) [@ghazouani\_nada](https://community.gatling.io/u/ghazouani_nada)\
**Post date:** [November 17, 2021, 6:33pm UTC](https://community.gatling.io/t/how-to-send-form-data-in-post-request/6313/2 "2021-11-17T18:33:33Z")

</div>

Hello,  
When i used :

.formParam(""“texte”"", “”“test”"")  
.formParam(""“ticket”"", “”“2"”")  
.formParam(""“createur”""", “”“53500"”")

I got 400 error in the application server =\> org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat

I need help please

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [November 17, 2021, 9:40pm UTC](https://community.gatling.io/t/how-to-send-form-data-in-post-request/6313/3 "2021-11-17T21:40:28Z")

</div>

.formParam(""“createur”""", “”“53500"”") =\> you have an extra double quote after createur

Then, as you’re not sending any file but only Strings, Gatling is going to encode the body into application/x-www-form-urlencoded, not multipart/form-data, even if you force the Content-Type header.

Either don’t force the Content-Type header so that the one Gatling will generate will match the one actually used for the body, or use formUpload to send a file in “attachments”
