Hi,
I have been trying to use the dispatch library to download a file via an http POST request. The server returns a "content-disposition" header suggesting a filename for the data file it returns.
I have succeeded reading the entire response body as a string,
http(r >~ { (x) => println(x.getLines.mkString("","\n","")) })
reading the response headers on their own
http(r >:> { (x) => println(x) })
and getting a BufferedReader for the response body
http(r >> { (x,c) => (new BufferedReader(new InputStreamReader(x,c))).readLine })
How would I go about getting the response headers AND the response body in one go using the dispatch lib? The docs are very sparse and I am new to Scala.
TIA
Michael