Asynchronous REST requests with proxy support.
Project description
rest-requests
Asynchronous SLURM REST requests with 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())
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-0.0.1.tar.gz
(10.7 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-0.0.1.tar.gz.
File metadata
- Download URL: rest_requests-0.0.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9973d972ec362ea31f871401b57c5a017d1d2699e6541fd49172a9b94a7761c8
|
|
| MD5 |
a1e70501643fd3f625157cac6472a3ae
|
|
| BLAKE2b-256 |
0b3ffd1d70cf5a3c4ddd14f4a172335dd41bfa1d576de971e11903d322e7f5d6
|
File details
Details for the file rest_requests-0.0.1-py3-none-any.whl.
File metadata
- Download URL: rest_requests-0.0.1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0db0dcae541a572628dec3e10f6fac983efbcafcc6514f65eee858ae7ad661a4
|
|
| MD5 |
ecefd67e8ccdaa6957768c16c8f4a479
|
|
| BLAKE2b-256 |
bc6ea92e5b8ceb1db2a8efac90ed990a1e5b71cd2332c9ccc77ea5f7571b65e2
|