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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asrequests-0.1.1.tar.gz
(4.1 kB
view details)
File details
Details for the file asrequests-0.1.1.tar.gz
.
File metadata
- Download URL: asrequests-0.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5db4d0f7dae4a1dd0169fe89fe62e5d44e510dfe3cfb182b4cd6c6151e27d66c |
|
MD5 | c82e257ec7c3be6c1321859bf8582419 |
|
BLAKE2b-256 | 9e77b9ffae26a3f1ddb7523e02353121fc8d4993bfa53b588566c7ded23a9c9f |