Re: [Gatling List] formUpload - change MIME type

174 views
Skip to first unread message

Stéphane Landelle

unread,
Nov 12, 2014, 3:42:18 PM11/12/14
to gat...@googlegroups.com
formUpload is just a utility that wraps a RawFileBodyPart + asMultipartForm

2014-11-12 21:24 GMT+01:00 Miguel González <mikh...@gmail.com>:
Hello

Care to explain how can I achieve this?

"The MIME Type of the uploaded file defaults to application/octet-stream and the character set defaults to the one configured in gatling.conf (UTF-8 by default). Don’t forget to override them when needed."

I don't where the mime type option is located on the conf file?

Regards


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Miguel González

unread,
Nov 12, 2014, 4:31:15 PM11/12/14
to gat...@googlegroups.com
so this will work, I guess

.bodyPart(RawFileBodyPart("file", data.xls").contentType("application/vnd.ms-excel").fileName("data.xls"))
.asMultipartForm

thanks

that should go on the documentation

Stéphane Landelle

unread,
Nov 12, 2014, 4:38:02 PM11/12/14
to gat...@googlegroups.com

47sai...@gmail.com

unread,
Nov 13, 2014, 6:35:12 AM11/13/14
to gat...@googlegroups.com
But how to upload the file for put operation....This is not working for put....What may be the solution in gatling 2.0

John Arrowwood

unread,
Nov 14, 2014, 11:09:04 AM11/14/14
to gat...@googlegroups.com
Send your code that is not working.

47sai...@gmail.com

unread,
Nov 14, 2014, 2:27:19 PM11/14/14
to gat...@googlegroups.com
Thanks john,,,,,Here I am giving my code....

 .exec(http("PUT_call")
.put("/users/posts/${postid}")
.headers(put_header)
.formParam("title", "Post with gatling")
.formParam("content", "Content of pos")
.formParam("author", "user12"))

And previously I got advice thta formParam will work for gatling 2.1...But I don't know how to do that...presently I am using gatling 2.0...So If that is the only solution please tell me the

Step by Step procedure to migrate...Actually In my case formParam and formUpload is not at all working....Please help me with detail solution.....As per my api I need only formParam.....

Thanks

John Arrowwood

unread,
Nov 14, 2014, 3:49:14 PM11/14/14
to gat...@googlegroups.com
So, what you are going to have to do is choose one of these two options:

1. Upgrade to Gatling 2.1
2. Figure out how to build the body of the PUT request manually

If you can't make option 1 work, then start here for option 2: http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1

47sai...@gmail.com

unread,
Nov 14, 2014, 10:18:31 PM11/14/14
to gat...@googlegroups.com
John...I know about forms....But what is the syntax to provide form to gatling???? 

John Arrowwood

unread,
Nov 17, 2014, 11:55:27 PM11/17/14
to gat...@googlegroups.com
Look at the format that it gets sent to the server in.  Any reason why you can't give it to Gatling exactly like that?

--
You received this message because you are subscribed to a topic in the Google Groups "Gatling User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gatling/vgsYES8yQtE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gatling+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
John Arrowwood,
Consulting Hypnotist / Hypnotherapist
http://www.JohnArrowwood.com
503.863.4823
Reply all
Reply to author
Forward
0 new messages