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-2.1.0.tar.gz (12.0 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-2.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rest_requests-2.1.0.tar.gz
Algorithm Hash digest
SHA256 3fd98a1b49f573d167e5d905a75e1d3910d5b52c0c44e5ce288c35646121e4c9
MD5 74247745969a74ffb14c396c76ef2449
BLAKE2b-256 fda034c318b1f5dff69473d03416725fdbefc48afe6772e8a1542d0d2bdfc3df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rest_requests-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97b9d2c8f5700178021ce9d64ab2cf714602fd3632bbd99193477659e725f61b
MD5 a4d20a1a74b737105a44564c6338de5c
BLAKE2b-256 7127bed392e6fe82f5428ca042dbb619657676c7cb4d5aac746dc890b0485ee4

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