Skip to content

How to deal with "java.util.zip.ZipException: Not in GZIP format" exception while processing request #427

Answered by ryber
DorisQQ2019 asked this question in Q&A
Discussion options

You must be logged in to vote

You can get ahold of the raw Apache InputStream when using the thenConsume method. This is before Unirest has read it, so it's the raw socket.

Unirest.get(path).thenConsume(raw -> {
            InputStream i = raw.getContent();
        });

once you have read the InputStream it can't be read again, which is why this method is a consumer.
Your real problem is that the API is reporting the content is gzipped but it's not. Have you reported this to the API owner?

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@DorisQQ2019
Comment options

@DorisQQ2019
Comment options

@ryber
Comment options

@ryber
Comment options

@DorisQQ2019
Comment options

Answer selected by DorisQQ2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants