reqivo.http packageΒΆ

SubmodulesΒΆ

reqivo.http.body moduleΒΆ

src/reqivo/http/body.py

HTTP body management (chunked, fixed-length, streaming) for Reqivo.

reqivo.http.body.read_exact(sock: socket, n: int) bytes[source]ΒΆ

Read exactly n bytes from the socket.

reqivo.http.body.iter_read_chunked(sock: socket) Generator[bytes, None, None][source]ΒΆ

Iterate over chunked transfer-encoded response.

reqivo.http.body.read_chunked(sock: socket) bytes[source]ΒΆ

Read full chunked body into memory.

reqivo.http.headers moduleΒΆ

src/reqivo/http/headers.py

Robust HTTP header management for Reqivo.

class reqivo.http.headers.Headers(headers: Dict[str, str | List[str]] | None = None)[source]ΒΆ

Bases: Mapping[str, str]

Case-insensitive dictionary for HTTP headers with support for multiple values.

Behaves like a dictionary where values are strings. duplicate headers are joined by commas (except Set-Cookie). Access raw lists via get_all().

get(key: str, default: Any = None) Any[source]ΒΆ

Get header value.

Parameters:
  • key – Header name (case-insensitive).

  • default – Default value if header not found.

Returns:

Comma-joined string for multiple values (except Set-Cookie which returns first), or default if not found.

get_all(key: str) List[str][source]ΒΆ

Get all values of a header.

Parameters:

key – Header name (case-insensitive).

Returns:

List of all values for the header, empty list if not found.

reqivo.http.http11 moduleΒΆ

src/reqivo/http/http11.py

Robust HTTP Parser implementation.

class reqivo.http.http11.HttpParser(max_header_size: int = 8192, max_line_size: int = 8192, max_field_count: int = 100, max_body_size: int | None = None)[source]ΒΆ

Bases: object

Robust HTTP/1.1 Parser.

Handles: - Status Line parsing. - Header parsing with duplicate handling. - Defensive sizing.

parse_response(data: bytes) Tuple[int, str, Dict[str, List[str]], bytes][source]ΒΆ

Parse a full raw HTTP response (or at least headers).

Returns:

Tuple of (status_code, status_line, headers, remaining_body)

Raises:

reqivo.http.status_codes moduleΒΆ

src/reqivo/http/status_codes.py

HTTP constants module.

This module will define HTTP-related constants such as status codes, header names, and protocol versions for use throughout Reqivo.

Currently empty - to be populated as needed.

reqivo.http.url moduleΒΆ

src/reqivo/http/url.py

URL builder and parser for Reqivo.

class reqivo.http.url.URL(url: str)[source]ΒΆ

Bases: object

Utility class for URL parsing and information.