Parameterize contentType and dispositionType Values

What would be the best way to parameterize the contentType and dispositionType in the following:

.bodyPart(RawFileBodyPart(session => getDataFilePathAsString(session(“file-relative-path”).as[String]).mkString)
.dispositionType(“form-data; name=“upload”; filename=“sample.pdf””))

The contentType value and the filename value in the dispositionType string are being fed in through a csv feeder like the following:






You can use Gatling EL to inject the file name in the dispositionType.
But contentType is currently a simple String.

I just implemented it for Gatling 2.1:

In the mean time, if you are not ready to upgrade, you should be able to use:

.header( “Content-type”, “${content-type}” )

No, because what Steven want is to set the part content-type, not the request content-type (which is multipart).

Missed that. Glad you didn’t. :slight_smile:

No pro. Thanks a lot for all your comments on this mailing list!

Hey Guys,

I changed to 2.1.0-SNAPSHOT and am able to parameterize contentType now but dispositionType still looks like a simple String:

def dispositionType(dispositionType: String) = copy(attributes = attributes.copy(dispositionType = Some(dispositionType)))

I tried by doing something like this:


but when I run it I am seeing this as the disposition type:

FilePart: name=null contentType=application/pdf dispositionType=${disposition-type} charset=UTF-8 transferEncoding=binary contentId=null filename=sample.pdf file=/Users/szaluk/code/qa/performance/src/test/resources/data/upload/sample.pdf

It seems like the substitutions are not being made. Am I doing this incorrectly?



My bad:

Thank you!

Not a problem. Hoping to bank up some good will for when I have questions… :wink: