A minimum rest client based on deboa http client for rust
Project description
paya
A minimum rest client based on deboa http client for rust
Installation
pip install paya
Usage
import asyncio
import json
import paya
from paya import send
async def main():
req = paya.Paya("https://jsonplaceholder.typicode.com").get("/todos/1")
res = await send(req)
data = json.loads(res.body())
print(data)
req = (
req.post("/posts")
.header("Content-Type", "application/json")
.body(
json.dumps(
{"title": "Some title", "body": "Some body", "userId": 1}
).encode("utf-8")
)
)
res = await send(req)
data = json.loads(res.body())
print(data)
req = req.delete("/posts/1")
res = await send(req)
data = json.loads(res.body())
print(data)
asyncio.run(main())
License
MIT
Author
Rogerio Pereira Araujo rogerio.araujo@gmail.com
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
paya-0.1.3.tar.gz
(14.4 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 paya-0.1.3.tar.gz.
File metadata
- Download URL: paya-0.1.3.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e330ab40d324915041e66b0bf5c2d086e1608cf71f0c15ca052a61d2a7ba0d36
|
|
| MD5 |
d3125cacb30578ac65460594a6b18a81
|
|
| BLAKE2b-256 |
64c9620d0665a30629663cef8dda9ddbf75e27e70e93a7e7d8bd261fa93fcdf6
|
File details
Details for the file paya-0.1.3-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: paya-0.1.3-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d42d709ca9c4f251f74f139c5d069ba8e6e45babc91681dea592a01ff687f7a
|
|
| MD5 |
044541a31337d489d8b8ef46c0801c74
|
|
| BLAKE2b-256 |
71303fdb0c2f79c88d7bdc0cdfc9814aea3e159d447692cd638692766358ec7c
|