Lightweight asynchronous REST API requests. JSON bodies only. Proxy support.
Project description
rest-requests
Lightweight asynchronous REST API requests. JSON bodies only. Proxy support.
Installation
pip install rest-requests
Usage
import asyncio
from rest_requests import request, RequestMethod
async def main():
response = await request(
method=RequestMethod.POST,
url="https://jsonplaceholder.typicode.com/posts",
# headers={"key": "value"},
body={"title": "foo", "body": "bar", "userId": 1},
# proxy_url="socks5://localhost:8080
)
assert response == {
"userId": 1,
"id": 101,
"title": "foo",
"body": "bar",
}
if __name__ == "__main__":
asyncio.run(main())
Contributors
License
rest-requests is distributed under the terms of the CC-BY-SA-4.0 license.
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
rest_requests-2.0.0.tar.gz
(11.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rest_requests-2.0.0.tar.gz.
File metadata
- Download URL: rest_requests-2.0.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e472788e0fb24243436a93eb39929b7b7250781951e30e47a1ac6827fa0be70d
|
|
| MD5 |
c136f485e3c86a967af6cd220130b43c
|
|
| BLAKE2b-256 |
6e019aae6064ff3c919ea6bc40508d6f1b3fb917b3d222eb85496d99e1b7ea28
|
File details
Details for the file rest_requests-2.0.0-py3-none-any.whl.
File metadata
- Download URL: rest_requests-2.0.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10e684c5961bdd37d1b2c65e01ebf8a650ab40979ac89e0a953457e85baa5569
|
|
| MD5 |
cd6eac4cc824abcf7272ee65f8ce8e31
|
|
| BLAKE2b-256 |
fa14d798a1345cb7c95fc52a6fed11bf006429673fa1eabc96b3917efe5fd282
|