Skip to main content

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.4.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

paya-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file paya-0.1.4.tar.gz.

File metadata

  • Download URL: paya-0.1.4.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.1

File hashes

Hashes for paya-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7c7fea15800ef5fdfc1bd390fe1163175a30b4be3d8e8ced53e9cee40030d106
MD5 de2cb307bcf572f56636968bdb9688c5
BLAKE2b-256 5eeb33dfe2aba32b107bca64c35bea49efb71db7f5a373a54d9941d2506dd6bf

See more details on using hashes here.

File details

Details for the file paya-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for paya-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9c22b371c57e0e3e9717faf121a913c910d46c97122bcdb94c052c80f218dba1
MD5 033be2a7c39cc1d9ab285ab07a6f88a9
BLAKE2b-256 8ba73d32218e8bb424dc6042b8cec5482705df01e194bade247e04b46cc73f7e

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