Getting an encoded stream is rather common from big data APIs. Having a default handler similar to the basic as.stream.Lines would be really handy for this kind of use case.
Here's an example implementation to connect to a gzip encoded stream:
/ "streams" / "track" / "tweets.json"
> as.stream.EncodedLines(println) )()```
I ended up resorting to bypassing dispatch-json4s-native and Future entirely and doing:
val stream = Http(req OK as.Response(_.getResponseBodyAsStream)).apply
val result =
see also http://stackoverflow.com/q/15800393/86485
It looks like the right place to implement this is as a ResponseFilter, if I'm reading it correctly:
Otherwise it needs to be implemented for as.String and stream.Strings.
But it should be a pretty straightforward enhancement if anybody wants to jump on it. I would just use a GZIPInputStream with a ByteArrayInputStream for each byte array.