Skip to main content

Lightweight asynchronous REST API requests. JSON bodies only. Proxy support.)

Project description

rest-requests

PyPI - Version PyPI - Python Version


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())

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

Uploaded Source

Built Distribution

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

rest_requests-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file rest_requests-1.0.0.tar.gz.

File metadata

  • Download URL: rest_requests-1.0.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for rest_requests-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dd6da9888c0006ee31e234b9c28ab0cd7c039312561a21aaa1ce633fbda5f1ef
MD5 a72552e4d9dfe99934f01bb2e37d9849
BLAKE2b-256 ba0e076e6a719926b6cbb2a522b14de499755c3ffe58ab7b5ae9c54193c4aa56

See more details on using hashes here.

File details

Details for the file rest_requests-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rest_requests-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6abd2dd854fdbda664bd624b54c9f96650a714e754c2226f1fb584746645a46
MD5 032e015e04d33c5e7ac00b0c7c005eaa
BLAKE2b-256 f6debbd18e8932708c70a9a8d2d239d7100656fad2104f18e73ee80927dfb160

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