Skip to main content

Requests + asyncio

Project description


This module contains an asynchronous method to send get and post http requests.

Use 'AsRequests' to send them.

Simple and effective.
:)

Usage is simple:

```
from asrequests import AsRequests

urls = [
'http://nodomain/',
'https://github.com',
'https://www.python.org/'
]
```

Send them all the same time.

```
>>> with AsRequests() as ar:
for i in urls:
ar.get(i)
...
>>>print(ar.result)
[<Response [200]>, ErrorRequest(url='http://nodomain/', text='', ...), <Response [200]>]
```

Using like requests:
```
from asrequests import asrequests

async def get_http():
for i in urls:
response = await asrequests.get(i)
print(response)

....
asyncio.run_until_complete(get_http)

===
<Response [200]>
ErrorRequest(url='http://nodomain/', text='', ...)
<Response [200]>
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for asrequests, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size asrequests-0.1.1.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page