Cannot decompress an encoded gzip stream #52

crockpotveggies opened this Issue Apr 4, 2013 · 3 comments

3 participants


Getting an encoded stream is rather common from big data APIs. Having a default handler similar to the basic would be really handy for this kind of use case.

Here's an example implementation to connect to a gzip encoded stream:

      .addHeader("Accept-Encoding", "gzip")
       /  "streams" / "track" / "tweets.json"
      > )()```

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 =

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment