(url)
| 6 | |
| 7 | |
| 8 | def curl(url): |
| 9 | session = aiohttp.ClientSession() |
| 10 | response = yield from session.request('GET', url) |
| 11 | print(repr(response)) |
| 12 | |
| 13 | chunk = yield from response.content.read() |
| 14 | print('Downloaded: %s' % len(chunk)) |
| 15 | |
| 16 | response.close() |
| 17 | session.close() |
| 18 | |
| 19 | |
| 20 | if __name__ == '__main__': |