.asMultipartForm

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 !

Hey!

You missed to include your code.
In the meantime, you can check the documentation about Multipart Form

Cheers!

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