https://github.com/timelessnesses/ez_aiohttp
Make aiohttp easier
https://github.com/timelessnesses/ez_aiohttp
Last synced: about 2 months ago
JSON representation
Make aiohttp easier
- Host: GitHub
- URL: https://github.com/timelessnesses/ez_aiohttp
- Owner: timelessnesses
- Created: 2021-12-31T05:27:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-31T05:43:24.000Z (over 4 years ago)
- Last Synced: 2025-01-01T15:42:56.670Z (over 1 year ago)
- Language: Python
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ez_aiohttp
The aiohttp wrapper to make it more like requests.
# How to use
It is kinda like requests, but it is async.
And you need to import aiohttp if you want to use more than GET,POST,PUT,PATCH,DELETE.
This just make it more simple.
Here's an example:
```py
import aiohttp,ez_rq,ez_rq.util
async def main():
a = ez_rq.get('https://www.google.com')
print(await a.text())
b = ez_rq.post('https://www.google.com',data={'a':'b'})
print(await b.text())
c = ez_rq.put('https://www.google.com',data={'a':'b'})
print(await c.text())
d = ez_rq.patch('https://www.google.com',data={'a':'b'})
print(await d.text())
e = ez_rq.delete('https://www.google.com')
print(await e.text())
f = await ez_rq.util.json2attr(a) # or you can send the dictionary
f.a = 'b'
print(await ez_rq.util.attr2json(f))
```
etc.
It always return `aiohttp.client_reqrep.ClientResponse` object.
[doc](https://ez-aiohttp.rukchadisa.live/en/latest/)