hubvault.remote.client
HTTP transport helpers for hubvault.remote.
This module delays httpx imports until the remote client is actually used,
so the base hubvault installation can still import the remote surface
without the remote extra installed.
The module contains:
build_http_client()- Construct the underlyinghttpxclient lazilyrequest_json()- Execute one JSON request with error mappingrequest_bytes()- Execute one binary request with error mapping
build_http_client
- hubvault.remote.client.build_http_client(**kwargs: Any)[source]
Build the underlying HTTP client lazily when remote extras are installed.
- Parameters:
kwargs (Any) – Keyword arguments forwarded to
httpx.Client- Returns:
Configured synchronous HTTP client
- Return type:
httpx.Client
- Raises:
hubvault.optional.MissingOptionalDependencyError – Raised when the remote extra is not installed.
request_json
- hubvault.remote.client.request_json(client, method: str, url: str, **kwargs: Any)[source]
Execute one JSON request and decode the payload.
- Parameters:
client (object) – Active HTTP client
method (str) – HTTP method name
url (str) – Relative or absolute request URL
kwargs (Any) – Additional request keyword arguments
- Returns:
Decoded JSON payload
- Return type:
object
- Raises:
hubvault.errors.HubVaultError – Raised when the server returns a structured application error.
hubvault.remote.errors.HubVaultRemoteError – Raised when transport or response parsing fails.
request_bytes
- hubvault.remote.client.request_bytes(client, method: str, url: str, **kwargs: Any) bytes[source]
Execute one binary request and return the response content.
- Parameters:
client (object) – Active HTTP client
method (str) – HTTP method name
url (str) – Relative or absolute request URL
kwargs (Any) – Additional request keyword arguments
- Returns:
Response content bytes
- Return type:
bytes
- Raises:
hubvault.errors.HubVaultError – Raised when the server returns a structured application error.
hubvault.remote.errors.HubVaultRemoteError – Raised when transport or response parsing fails.