Yet Another Asyncio Requets
Project description
Yet Another Asyncio Requests
Install and usage are as expected. To install:
$ pip install yaar
And then the usage:
import yaar
response = await yaar.get(url)
print(response.status, response.text)
print(response.json())
# send a json in the request body
response = await yaar.post(url, json={"some": "json"})
print(response.status)
To send headers in your request use:
response = await yaar.get(url, headers={'Authentication': 'bearer} XYZ')
Here you have all usual the methods like put
, delete
, etc..
In case you need a custom session you can use:
session = aiohttp.ClientSession(loop=loop)
response = await yaar.get(url, session=session)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yaar-0.2.tar.gz
(2.8 kB
view hashes)