Skip to content

Instantly share code, notes, and snippets.

@saghul
Created November 27, 2013 08:27
Show Gist options
  • Save saghul/7672426 to your computer and use it in GitHub Desktop.
Save saghul/7672426 to your computer and use it in GitHub Desktop.
import erequests
import os
HTTPBIN_URL = os.environ.get('HTTPBIN_URL', 'http://httpbin.org/')
def httpbin(*suffix):
"""Returns url for HTTPBIN resource."""
return HTTPBIN_URL + '/'.join(suffix)
r = list(erequests.map([erequests.AsyncRequest.get(httpbin('stream/10'), stream=True)], size=2))[0]
print r._content_consumed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment