Hi I am getting an error while uploading video. It says -
“akka.http.scaladsl.model.IllegalHeaderException: multipart/form-data part must contain Content-Disposition
header with name
parameter”
.exec(http("request_1") // Here's an example of a POST request
.post("upload?")
.headers(
Map("Content-Type" -> "multipart/form-data")
)
.headers(Map("Content-Disposition" -> """form-data; name="file""""))
.headers(Map("name" -> "file"))
.bodyPart(RawFileBodyPart("xyz.MP4")
.contentType("video/mp4")
.fileName("xyz.MP4")
.dispositionType("Content-Disposition")
.addP
.fileName("xyz.MP4")
.header("Content-Disposition", "name")
).asMultipartForm
.queryParam("""xyz""", """true""") // Note the triple double quotes: used in Scala for protecting a whole chain of characters (no need for backslash)
Need some help over here.