Play 2.0 Cómo publicar MultipartFormData usando WS.url o WS.WSRequest
En la solicitud de HTTP Http, podemos hacer esto para hacer POST HTTP multiparte.
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
FileBody bin = new FileBody(new File(fileName));
StringBody comment = new StringBody("Filename: " + fileName);
MultipartEntity reqEntity = new MultipartEntity();
reqEntity.addPart("bin", bin);
reqEntity.addPart("comment", comment);
httppost.setEntity(reqEntity);
HttpResponse response = httpclient.execute(httppost);
HttpEntity resEntity = response.getEntity();
¿Cómo podría lograr lo mismo usando WS.url o WS.WSRequest?
WSRequestHolder wsReq = WS.url("http//url");
wsReq.setHeader("Content-type", "multipart/form-data");