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”)

.exec(http(“HTML_WRITE”)
.post("/api/core/v3/contents")
.headers(headers_api_post)
.bodyPart(StringBodyPart(“json”, “${postBody}”, “utf-8”, contentType))
.bodyPart(RawFileBodyPart(“binary”, “${path}”, “${type}”).withFileName("${fileName}"))
.check(status.is(201)))

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?

Thx
Shawna

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!