Skip to main content

Asynchronous REST requests with 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())

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.2.tar.gz (10.8 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-0.0.2-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rest_requests-0.0.2.tar.gz
Algorithm Hash digest
SHA256 60cbcaf357f0946eae8bb5d849ce8685a6b2aa90c6e093b63eaef0cf5d968ee4
MD5 836419245f286bb570d24bc4b98a711d
BLAKE2b-256 54f072180fb0b1505157165fd816b25c47049c90c374c62ca0eb8409d65e1de2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rest_requests-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3668321d12fa773b775bad2fbdd2c9772d2cd3059e82d2304a6efc67ca76c158
MD5 841705a0df97e218d20cf7530d4797d7
BLAKE2b-256 ff8750f4b1b64620de72fd01e2aba15d3e186ce43e4c5ee49ca772cbd96295cd

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