Skip to content

Instantly share code, notes, and snippets.

@aantn
Created April 11, 2011 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aantn/913423 to your computer and use it in GitHub Desktop.
Save aantn/913423 to your computer and use it in GitHub Desktop.
Decompressing StackOverflow HTTP Responses
import zlib
import requests
r = requests.get('http://api.stackoverflow.com/1.1/users/495995/top-answer-tags')
print r.content
print zlib.decompress(r.content, 16+zlib.MAX_WBITS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment