# .asMultipartForm

**URL:** <https://community.gatling.io/t/asmultipartform/6199>\
**Category:** Gatling (Open-Source)\
**Created:** [July 25, 2021, 4:24pm UTC](https://community.gatling.io/t/asmultipartform/6199 "2021-07-25T16:24:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leofay](https://avatars.discourse-cdn.com/v4/letter/l/8edcca/32.png) [@Leofay](https://community.gatling.io/u/Leofay)\
**Post date:** [July 25, 2021, 4:24pm UTC](https://community.gatling.io/t/asmultipartform/6199/1 "2021-07-25T16:24:35Z")

</div>

I need to send a post request with form-data body which contains two keys :

1. justificatifs : text (json)

2. document : file (pdf) . How can i do this via gatling ? My code :

Thanks !

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [July 26, 2021, 7:20am UTC](https://community.gatling.io/t/asmultipartform/6199/2 "2021-07-26T07:20:55Z")

</div>

Hey!

You missed to include your code.  
In the meantime, you can check the documentation about [Multipart Form](https://gatling.io/docs/gatling/reference/current/http/request/#multipart-form)

Cheers!

---

<div class="post-metadata">

**Author:** ![Leofay](https://avatars.discourse-cdn.com/v4/letter/l/8edcca/32.png) [@Leofay](https://community.gatling.io/u/Leofay)\
**Post date:** [July 26, 2021, 8:40am UTC](https://community.gatling.io/t/asmultipartform/6199/3 "2021-07-26T08:40:47Z")

</div>

Hello , my code is :

.exec(http(“ajouter un…”)  
.post("/api/…/")  
.header(“Authorization”,“Bearer " +”${accessToken}")  
.header(“Content-Type”, “multipart/form-data”)  
.formParam(“justificatif”, “value =JSON CODE”)  
.formUpload(“documents”,“identite\_test.pdf”)  
.bodyPart(RawFileBodyPart(“file”, “identite\_test.pdf”)  
.contentType(“application/pdf”)  
.fileName(“identite\_test.pdf”))  
.asMultipartForm  
.check(status is 201))

Thanks
