Hello,
I have a post request, the body is of type form-data
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
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
.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”