Skip to main content

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

Project description

rest-requests

PyPI - Version PyPI - Python Version


Lightweight asynchronous REST API requests. JSON bodies only. 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.1.0.tar.gz (11.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.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rest_requests-1.1.0.tar.gz
Algorithm Hash digest
SHA256 dd37ed2d91be15d5f3c9db1f74d72c4bd3fb107bf260ea22d876a6b5e665a560
MD5 05fa621bc8067c16aee9c5bba89c684c
BLAKE2b-256 eb8c7afcccebbbb3f95a1ed1dc8960c7ecad60b9f83a2c365a6d220bb8116ffa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rest_requests-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aba11c9ae97a63f8f0ed3a661c05e1d033808f763267c047ec2394a8272a28c0
MD5 faa66035c1ff57550e7b23cb125f63e4
BLAKE2b-256 646abf31a22a95e5d75193e083a1da90eb1687df4dbf6fea68bfad642e776a4c

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