Skip to main content

without-http

A sans-IO-backed ASGI server and HTTP client for without. Where without-asgi is the app side of the ASGI boundary (it turns a server's receive/send into typed streams), without-http is the server side: it owns the socket and the HTTP wire protocol, and drives any ASGI app via app(scope, receive, send).

The wire-protocol state machines are themselves sans-IO libraries: h11 for HTTP/1.1, h2 for HTTP/2, and wsproto for WebSockets. without-http reads and writes socket bytes with asyncio, feeds them through those state machines, and uses without-asgi's server-direction codecs to translate between typed events and the ASGI dicts an app expects.

from without import sleep_forever
from without_asgi import make_asgi_app
from without_http import ConnectionPool, request, serving

app = make_asgi_app(lifespan, http=router.dispatch, websocket=sockets.dispatch)

async with serving(app, host="127.0.0.1", port=8000):
    await sleep_forever()  # run until cancelled

async with ConnectionPool() as pool:
    async with request(pool, "GET", "http://127.0.0.1:8000/items") as (head, body):
        assert head.status == 200
        data = await body.read()

Because without-http speaks plain ASGI to the app, any ASGI app runs over it, interchangeably with uvicorn. The server handles TLS, HTTP/2 (by ALPN or prior knowledge), keep-alive, WebSockets over the HTTP/1.1 upgrade, per-handler isolation, and flow control. A client is a function from a request to a response, and a ConnectionPool is the one that answers over the network: a (head, body) response split, buffered and streaming bodies in both directions, opt-in trailers, HTTP/2 multiplexing, per-host connection bounds, per-phase request timeouts, consumer-driven duplex (with bidirectional streaming over HTTP/2), and stack-composed middleware.

without_http.testing carries the same interface into a test: a mock client that answers from a function, an ASGI client that drives an app in memory, and a loopback client that runs the real wire protocols over no socket at all, plus the raw in-memory endpoints those are built from, for a test that writes frames rather than requests.

See the without-http guide (with the API reference) for the full surface, and Alternatives for where the client and server stand against httpx, aiohttp, niquests, and the ASGI servers, including which absences are gaps and which are positions.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

without_http-0.0.4.tar.gz (65.8 kB view details)

Uploaded Source

Built Distribution

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

without_http-0.0.4-py3-none-any.whl (72.4 kB view details)

Uploaded Python 3

File details

Details for the file without_http-0.0.4.tar.gz.

File metadata

  • Download URL: without_http-0.0.4.tar.gz
  • Upload date:
  • Size: 65.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for without_http-0.0.4.tar.gz
Algorithm Hash digest
SHA256 07b8bd4566087a3d4c7739b990e3c7b41ec4686a05e7c1107f9ea91bb99c29d2
MD5 cdab18e196eb57bfff05ef5fb41cb784
BLAKE2b-256 fcdfe1ddc2fba928a51b836b0e14db0665c5ad66e57f7a674428c5aae34dc10a

See more details on using hashes here.

File details

Details for the file without_http-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: without_http-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 72.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for without_http-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d15daf6fb3c55419b754dc44fe569c12d67fb7d7f1a4a73dd92e2e0a441b26c4
MD5 9a370e1b61081f9b416174bddf658bbc
BLAKE2b-256 c4921da7e6922c10b17577f0894bf6cd3e85c4d34adcbdecedd2d5040744f19a

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 Sentry Error logging StatusPage Status page