reqivo.client packageΒΆ
SubmodulesΒΆ
reqivo.client.auth moduleΒΆ
src/reqivo/client/auth.py
Authentication helpers for Reqivo.
reqivo.client.request moduleΒΆ
src/reqivo/client/request.py
HTTP request builder and sender.
- class reqivo.client.request.Request[source]ΒΆ
Bases:
objectHTTP request builder and sender.
- classmethod set_session_instance(session: Session | None) None[source]ΒΆ
Sets the current session instance for the request.
- static build_request(method: str, path: str, host: str, headers: Dict[str, str], body: str | bytes | None) bytes[source]ΒΆ
Builds the raw HTTP request bytes.
- classmethod send(method: str, url: str, headers: Dict[str, str] | None = None, body: str | bytes | None = None, timeout: float | Timeout | None = 5, connection: Connection | None = None, allow_redirects: bool = True, max_redirects: int = 30, limits: Dict[str, int] | None = None) Response[source]ΒΆ
Sends an HTTP request with automatic redirects support.
- class reqivo.client.request.AsyncRequest[source]ΒΆ
Bases:
objectAsynchronous HTTP request builder and sender.
- classmethod set_session_instance(session: AsyncSession | None) None[source]ΒΆ
Sets the current session instance for the async request.
- async classmethod send(method: str, url: str, headers: Dict[str, str] | None = None, body: str | bytes | None = None, timeout: float | Timeout | None = 5, connection: AsyncConnection | None = None, allow_redirects: bool = True, max_redirects: int = 30, limits: Dict[str, int] | None = None) Response[source]ΒΆ
Sends an async request with automatic redirects support.
reqivo.client.response moduleΒΆ
src/reqivo/client/response.py
HTTP Response handling module.
This module provides classes for parsing and handling HTTP responses, including status line, headers, and body parsing.
- exception reqivo.client.response.ResponseParseError[source]ΒΆ
Bases:
ExceptionException raised when HTTP response parsing fails.
- class reqivo.client.response.Response(raw_response: bytes, connection: Connection | None = None, stream: bool = False, limits: Dict[str, int] | None = None)[source]ΒΆ
Bases:
objectRepresents a parsed HTTP response.
- rawΒΆ
Original raw response bytes (headers + initial body).
- status_lineΒΆ
HTTP status line (e.g., βHTTP/1.1 200 OKβ).
- status_codeΒΆ
HTTP status code as integer.
- headersΒΆ
Dictionary of response headers (normalized to Title-Case).
- bodyΒΆ
Response body as bytes (full content if stream=False).
- urlΒΆ
URL of the response (if set externally).
- iter_content(chunk_size: int = 4096) Generator[bytes, None, None][source]ΒΆ
Iterate over the response body.
- Parameters:
chunk_size β Size of chunks to read.
- Yields:
Bytes chunks.
reqivo.client.session moduleΒΆ
src/reqivo/client/session.py
HTTP Session management module.
This module provides session functionality for persistent HTTP connections, cookie management, authentication, and request state across multiple HTTP calls.
- class reqivo.client.session.Session(limits: Dict[str, int] | None = None)[source]ΒΆ
Bases:
objectHTTP session manager for persistent connections and state.
This class manages session-specific data like cookies, persistent headers, and authentication credentials across multiple requests.
- cookiesΒΆ
Dictionary of stored cookies.
- headersΒΆ
Persistent headers for all requests.
- poolΒΆ
Connection pool for reuse.
- _basic_authΒΆ
Basic authentication credentials.
- _bearer_tokenΒΆ
Bearer token for authentication.
- set_basic_auth(username: str, password: str) None[source]ΒΆ
Set Basic Auth credentials for the session.
- Parameters:
username β Username for authentication.
password β Password for authentication.
- set_bearer_token(token: str) None[source]ΒΆ
Set Bearer token for the session.
- Parameters:
token β Bearer token for authentication.
- get(url: str, headers: Dict[str, str] | None = None, timeout: float | None = 5, limits: Dict[str, int] | None = None) Response[source]ΒΆ
Sends a GET request.
reqivo.client.websocket moduleΒΆ
src/reqivo/client/websocket.py
WebSocket client implementation (Sync and Async).
- class reqivo.client.websocket.WebSocket(url: str, timeout: float | None = None, headers: Dict[str, str] | None = None, subprotocols: List[str] | None = None)[source]ΒΆ
Bases:
objectSynchronous WebSocket Client.