On 23 Maj, 18:32, Sadache Aldrobi <
sadek.dr...@gmail.com> wrote:
> It is not possible with the current api.
I hope it will be added in some future version. I managed to do it by
using parts of Apache Http Client, but it resulted in quite messy
code:
Dependency in Build.scala: "org.apache.httpcomponents" % "httpclient"
% "4.2"
Code:
val boundary = "-----{}}AAA{{}-----"
val multipart = new HttpMultipart("form-data", boundary)
multipart.addBodyPart(new FormBodyPart("file", new
StringBody(myData)))
val buffer = new ByteArrayOutputStream()
multipart.writeTo(buffer)
val data = buffer.toByteArray
WS.url(myUrl).withHeaders((HeaderNames.CONTENT_TYPE, "multipart/
form-data; boundary="+boundary)).post(data)