MCPcopy
hub / github.com/aio-libs/aiohttp / curl

Function curl

examples/curl.py:8–17  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

6
7
8def 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
20if __name__ == '__main__':

Callers 1

curl.pyFile · 0.85

Calls 4

requestMethod · 0.95
closeMethod · 0.95
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected