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.3.tar.gz (14.4 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.3-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.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

Hashes for paya-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e330ab40d324915041e66b0bf5c2d086e1608cf71f0c15ca052a61d2a7ba0d36
MD5 d3125cacb30578ac65460594a6b18a81
BLAKE2b-256 64c9620d0665a30629663cef8dda9ddbf75e27e70e93a7e7d8bd261fa93fcdf6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for paya-0.1.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8d42d709ca9c4f251f74f139c5d069ba8e6e45babc91681dea592a01ff687f7a
MD5 044541a31337d489d8b8ef46c0801c74
BLAKE2b-256 71303fdb0c2f79c88d7bdc0cdfc9814aea3e159d447692cd638692766358ec7c

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