Skip to main content

A thin wrapper for aiohttp client with Requests simplicity

Project description

aiohttp-requests

Behold, the power of aiohttp client with Requests simplicity:

>>> import asyncio
>>>
>>> import aiohttp
>>> from aiohttp_requests import requests
>>>
>>> async def main():
...     response = await requests.get('https://api.github.com/user', auth=aiohttp.BasicAuth('user', 'password'))
...     text = await response.text()
...     json = await response.json()
...     return response, text, json
...
>>> loop = asyncio.get_event_loop()
>>> r, text, json = loop.run_until_complete(main())
>>>
>>> r
<ClientResponse(https://api.github.com/user) [200 OK]>
>>> r.status
200
>>> r.headers['Content-Type']
'application/json; charset=utf-8'
>>> r.get_encoding()
'utf-8'
>>> text
'{"login":"...'
>>> json
{'login': 'user', 'public_repos': 28, ...}

The requests object is just proxying get and any other HTTP verb methods to aiohttp.ClientSession, which returns aiohttp.ClientResponse. To do anything else, just read the aiohttp doc.

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

aiohttp-requests-0.1.3.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiohttp_requests-0.1.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file aiohttp-requests-0.1.3.tar.gz.

File metadata

  • Download URL: aiohttp-requests-0.1.3.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.3

File hashes

Hashes for aiohttp-requests-0.1.3.tar.gz
Algorithm Hash digest
SHA256 eef51aead04363c14a629f8480c88e5bbe421c0ba3e5ef4a8b6fe8ece4a232dd
MD5 41e321b758b5b9705c6677b2aa8f66ea
BLAKE2b-256 237af89df8a0a00a56b025f552932714ec3f3bac798359474a37937741fe9844

See more details on using hashes here.

File details

Details for the file aiohttp_requests-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: aiohttp_requests-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.3

File hashes

Hashes for aiohttp_requests-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3f284a7d1bc1d82c5d5d75d61ac2d8b666b854d542b34c91e69d57ed5d51db73
MD5 f28167ad260480309a40bb1968a90a1e
BLAKE2b-256 f5ce9d1f1d5bd22084fa6ad4769605217f270d114059a04994ee0e60ac2710ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page