Skip to main content

aiohttp-api-client

Requires: python 3.6+, aiohttp.

Example:

import aiohttp
from aiohttp_api_client.json_api import \
    JsonApiClient, JsonApiRequest, JsonApiError, JsonApiDetails

async def run(http_client: aiohttp.ClientSession):
    api_client = JsonApiClient(http_client)

    response = await api_client(JsonApiRequest('GET', 'https://example.com/api/'))
    assert response.json == {'ok': True}

    try:
        await api_client(JsonApiRequest('GET', 'https://example.com/api/bad-request/'))
    except JsonApiError as e:
        assert e.details == JsonApiDetails(
            http_status=400, http_reason='Bad Request', content_type='application/json',
            bytes=b'{"ok": false}', text='{"ok": false}',
        )
    else:
        assert False

Metadata

Release files for aiohttp-api-client 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiohttp-api-client 0.2.0
File Size Uploaded
aiohttp-api-client-0.2.0.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiohttp-api-client 0.2.0
File Interpreter ABI Platform
aiohttp_api_client-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.7 kB

Release files / aiohttp-api-client-0.2.0.tar.gz

Download URL aiohttp-api-client-0.2.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8c5d1b191b7703f7f4aa4bf4921be356293891303d5c544c5f6c7d19573bfcae
BLAKE2b-256 checksum
How to use checksums
dc8e301c49d13ce570e4dee9788f61ed16e686a5211c938363c4bbf0ceb3c9d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Release files / aiohttp_api_client-0.2.0-py3-none-any.whl

Download URL aiohttp_api_client-0.2.0-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eaf2d5c893b73ee07249be72c99e8aec9c80e3a0c824e34e36bca5d6d871e14e
BLAKE2b-256 checksum
How to use checksums
8272fc1e8d89df16f0ef73415f3e4e9264fe8455a8a9bca8ec5e27a5142ab8cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page