Skip to main content

A lightweight asyncio HTTP client

Project description

bareClient

A simple asyncio http Python client package supporting HTTP versions 1.0, 1.1 and 2 (read the docs).

This is the client companion to the ASGI server side web framework bareASGI and follows the same "bare" approach. It makes little attempt to provide any helpful features which might do unnecessary work, providing a foundation for whatever feature set is required.

Features

The client has the following notable features:

  • Lightweight
  • Uses asyncio
  • Supports HTTP versions 1.0, 1.1, 2
  • Supports middleware

Installation

The package can be installed with pip.

pip install bareclient

This is a Python3.7 and later package.

It has dependencies on:

Usage

The basic usage is to create an HttpClient.

import asyncio
from typing import List, Optional
from bareclient import HttpClient

async def main(url: str) -> None:
    async with HttpClient(url) as response:
        if response.ok and response.more_body:
            async for part in response.body:
                print(part)

asyncio.run(main('https://docs.python.org/3/library/cgi.html'))

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

bareclient-5.0.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bareclient-5.0.0-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file bareclient-5.0.0.tar.gz.

File metadata

  • Download URL: bareclient-5.0.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.6 Darwin/19.6.0

File hashes

Hashes for bareclient-5.0.0.tar.gz
Algorithm Hash digest
SHA256 305d2288266188a5023f62c4308433ab084ad55e2e3be9597ffff8a81e4644cb
MD5 6535254bb21ba23615a4196d93aba56e
BLAKE2b-256 0d2e3f338fa8779a9b23cd2c402e17f7ea87e6c86e4fee88cf634aa19aaac127

See more details on using hashes here.

File details

Details for the file bareclient-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: bareclient-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.6 Darwin/19.6.0

File hashes

Hashes for bareclient-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e93a702a89142e33f2443894ad9dec47fb4b09b7517e82df953f65562a206332
MD5 3fbc6889493a1b291fe2ad82cff5b81d
BLAKE2b-256 29cf6d66c52d0d9c20c6dd4fffa60147331b9a49cfae11803dc7e256f406f792

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