Hey there,
i'm trying to upload multiple 'files' with dispatch, but i'm having some troubles. Could you please tell me what am i doing wrong? This is the code i'm trying to run, although i tried like 30 different combinations of operators so i'm not sure if it even makes sense anymore :) val file: File = ... server <<* (file.getName,file) << ("data","data.json",() => new java.io.ByteArrayInputStream(req.toJson.toString.getBytes), "application/json") As you can see, i'm trying to send a file first, followed by content of string, but this won't compile. It says: overloaded method value << with alternatives: [error] (stringbody: String,contenttype: String)dispatch.Request <and> [error] (stringbody: String)dispatch.Request <and> [error] (values: Traversable[(String, String)])dispatch.Request [error] cannot be applied to (java.lang.String, java.lang.String, () => java.io.ByteArrayInputStream, java.lang.String) [error] val post = c.constants.api.upload <<* (file.getName,file) << ("data","data.json",() => new java.io.ByteArrayInputStream(req.toJson.toString.getBytes), "application/json") [error] ^ [error] one error found I imported both dispatch.mime._ and dispatach.mime.Mime._, i use 0.8.5 version of dispatch. Many thanks for any answer! Tomas |
Administrator
|
Hi Tomas, the Dispatch listserv is over here now:
https://groups.google.com/forum/?hl=en#!forum/dispatch-scala On 02/04/2012 06:32 PM, Tomas Herman [via Databinder] wrote: Hey there, |
Ooops, sorry :)
|
Free forum by Nabble | Edit this page |