Thanks for the hint, I still have trouble using the Mime's "<<" method.
In the example the first "<<" method is of type Request, the second "<<" method of class MimeRequest but the compiler does not see it:
overloaded method value << with alternatives: (string_body: String)dispatch.Request <and> (values: scala.collection.Map[String,Any])dispatch.Request cannot be applied to (java.lang.String, java.io.File)
val post = :/("localhost") << Map(
"commit" -> "true",
) << ("filename", new java.io.File("path/to/file"))
val http = new dispatch.Http
http(post >>> System.out)
Could you provide a small example in case I did not want to use a file but a Stream instead?
It looks like the << method expects a function returning an InputStream but the following somehow does not work:
def getStream = new FileInputStream(new File("/path/to/file"))
val post = server << Map(
"id" -> "42",
) << ("name","filename", getStream)