Created
January 26, 2016 21:13
-
-
Save asvetlov/64cd475d5c080a711ce4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def fetch(session, url): | |
async with session.get(url) as resp: | |
if resp.headers['Content-Type'] != 'plain/text': | |
resp.close() | |
else: | |
text = await resp.text() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, if just after
resp.close()
I doprint(await resp.content.read(n))
where n is 10 for instance, I can see 10 bytes of the body whereas I was expecting the body to be empty. Does it seem correct to you ?