Skip to main content

Build Status Coverage Code Climate MIT License

httoop

An object-oriented HTTP/1.x protocol library for Python.

Httoop is for applications that need to understand HTTP, not merely send a request. It parses and composes requests and responses, and gives every important part of a message a useful object: methods, URIs, protocols, headers, statuses, and bodies. The same model can be used to build protocol-aware clients, servers, gateways, middleware, caches, and proxies.

Why httoop?

Most HTTP libraries make the network convenient by hiding the protocol. Httoop takes a different approach: it makes the protocol convenient to work with. You can inspect, validate, transform, and re-compose a message without dropping down to ad-hoc string manipulation or abandoning the HTTP wire format.

  • One coherent object model. HTTP values share a small semantic interface: they can be parsed, composed, converted to bytes, compared, and represented consistently.
  • Incremental by design. The state-machine parser accepts fragmented input, supports pipelined messages, handles fixed-length and chunked bodies, and preserves trailers.
  • Structured instead of stringly typed. Headers and URIs expose parsed components, parameters, normalization, joining, and validation. Cookies, ranges, content types, dates, authentication fields, and security headers do not need to be hand-parsed.
  • Streaming without special cases. A body can be bytes, text, a file, a file-like object, or an iterable. The same body abstraction handles content encoding, transfer encoding, chunking, and limits.
  • Protocol-aware composition. Request and response preparation takes care of HTTP details such as Host, Content-Length, Date, connection semantics, bodyless statuses, HEAD, and byte ranges.
  • Safe boundaries for untrusted input. Header counts and sizes, URI lengths, body sizes, and decompressed body sizes can be bounded explicitly, while malformed framing and invalid fields are rejected.
  • Designed to be extended. New header elements, URI schemes, statuses, and media codecs can be registered and used through the same interfaces as the built-ins.
  • Integration where it matters. WSGI support provides a bridge to existing Python web applications without requiring a second message representation.

The Zen of httoop

Httoop follows a few simple principles:

  1. Model HTTP as meaning, not as text. Wire bytes are an input and output format; inside the application, HTTP should be represented by objects with explicit semantics.
  2. Separate syntax, semantics, and transport. Parsing answers "is this a valid message?", composition answers "what should this message mean on the wire?", and adapters answer "where does it run?". Each layer can evolve independently.
  3. Make the wire visible when it matters. Httoop does not hide framing, headers, status codes, encodings, or protocol versions. This makes unusual HTTP behavior possible to inspect and reason about.
  4. Treat partial input and large bodies as normal. Streaming, buffering, pipelining, and resource limits are part of the model rather than afterthoughts.
  5. Prefer composition over special-purpose APIs. The same Request, Response, Headers, URI, and Body objects work across clients, servers, gateways, and middleware.
  6. Extend by adding knowledge, not by rewriting the core. Protocol extensions plug into registries and semantic types instead of requiring changes throughout the parser.

HTTP standards

HTTP and extensions are defined in the following RFC's:

Extended information about hypermedia, WWW and how HTTP is meant to be used:

Clarifications of misconceptions people have about REST:

OAuth 2.0:

Obsolete:

Metadata

Release files for httoop 0.2.2

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

Source distribution (sdist)

Source distribution for httoop 0.2.2
File Size Uploaded Provenance Actions
httoop-0.2.2.tar.gz 68.0 kB With provenance Details for httoop-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for httoop 0.2.2
File Interpreter ABI Platform Actions
httoop-0.2.2-py3-none-any.whl Python 3 none any Details for httoop-0.2.2-py3-none-any.whl

Total release size: 152.2 kB

Release files / httoop-0.2.2.tar.gz

Download URL httoop-0.2.2.tar.gz
Size 68.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9d74879556e861cb76fc3b7d225599c67cbe868968823f881a14703c3de18b9f
BLAKE2b-256 checksum
How to use checksums
18b25e498c482868dce80ecc180003b2963b192b7f75bd486a44b56b2e313e4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / httoop-0.2.2-py3-none-any.whl

Download URL httoop-0.2.2-py3-none-any.whl
Size 84.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25b46e6edb7b55229b54f0b3668d11c6e16b80547b10322b228e8acd2e1f4140
BLAKE2b-256 checksum
How to use checksums
d59023c57ca095c2045a224d35b92a37f947fdcc97f4b94e1e9fbd0849a3f3ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for httoop 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for httoop-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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