Syntax for the body part change for m3a to 2.0.0-snapshot

I am moving the project from using 2.0.0-M3a to 2.0.0-SNAPSHOT. The below syntax works fine before does not work anymore:

val contentType: Option[String] = Some(“application/json”)

.bodyPart(StringBodyPart(“json”, “${postBody}”, “utf-8”, contentType))
.bodyPart(RawFileBodyPart(“binary”, “${path}”, “${type}”).withFileName("${fileName}"))

especially the bodyPart (RawFileBodyPart). I was trying to look through the gatling source to see if I can get it fix but kept getting errors. Can you help to verify the correct form?


All optional parameters are now set with a dedicated method.

.bodyPart(StringBodyPart(“json”, “${postBody}”).charset(“utf-8”).contentType(“contentType”))

.bodyPart(RawFileBodyPart(“binary”, “${path}”).contentType("${type}").fileName("${fileName}"))

cool, thx!