Metadata-Version: 2.4
Name: rest-requests
Version: 1.1.0
Summary: Lightweight asynchronous REST API requests. JSON bodies only. Proxy support.
Project-URL: Documentation, https://github.com/Kwasniok/pypi-rest-requests#readme
Project-URL: Issues, https://github.com/Kwasniok/pypi-rest-requests/issues
Project-URL: Source, https://github.com/Kwasniok/pypi-rest-requests
Author-email: Kwasniok <Kwasniok@users.noreply.github.com>, AlexanderKlemps <AlexanderKlemps@users.noreply.github.com>
Maintainer-email: Kwasniok <Kwasniok@users.noreply.github.com>
License-Expression: CC-BY-SA-4.0
License-File: LICENSE.txt
Keywords: api,rest
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Requires-Dist: aiohttp-socks>=0.10
Requires-Dist: aiohttp>=3.13
Description-Content-Type: text/markdown

# rest-requests

[![PyPI - Version](https://img.shields.io/pypi/v/rest-requests.svg)](https://pypi.org/project/rest-requests)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rest-requests.svg)](https://pypi.org/project/rest-requests)

-----

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

## Installation

```console
pip install rest-requests
```

## Usage

```python
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

- [@AlexanderKlemps](https://github.com/AlexanderKlemps)
- [@Kwasniok](https://github.com/Kwasniok)

## License

`rest-requests` is distributed under the terms of the [CC-BY-SA-4.0](http://creativecommons.org/licenses/by-sa/4.0) license.
