Tom Christie 8486e3c720 Version 0.1.0
2019-03-21 14:19:21 +00:00
2019-03-21 14:19:21 +00:00
2019-03-21 11:26:42 +00:00
2019-03-21 13:17:11 +00:00
2019-03-21 11:26:42 +00:00
2019-03-21 11:58:07 +00:00
2019-03-21 14:18:33 +00:00
2019-03-21 11:26:42 +00:00
2019-03-21 11:26:42 +00:00

requests-async

Brings support for async/await syntax to Python's fabulous requests library.

Build Status Coverage Package version

Contributions towards closing off our outstanding issues would be very welcome! 🍰

Requirements

  • Python 3.6, 3.7.

Installation

$ pip install requests-async

Usage:

Just use the standard requests API, but use await for making requests.

Note: Use ipython to try this from the console, since it supports await.

import requests_async as requests


response = await requests.get('https://example.org')
print(response.status_code)
print(response.text)

Or use explicit sessions.

import requests_async as requests


with requests.Session() as session:
    response = await requests.get('https://example.org')
    print(response.status_code)
    print(response.text)

The requests_async package subclasses requests, so you're getting all the standard behavior and API you'd expect.

Limitations

  • Streaming uploads and downloads are unsupported.
  • SSL verification is not currently enabled.
  • No timeout support yet.

See the issues list for more details.

Alternatives

The aiohttp package provides an alternative client for making async HTTP requests.

S
Description
No description provided
Readme 60 KiB
Languages
Python 96.2%
Shell 3.8%