ovok_sdk.http.client

The authenticated JSON client every namespace sends through.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.25+2ba84b0

The authenticated JSON client every namespace sends through.

HttpContext

HttpContext(settings: OvokSettings, credentials: Credentials, retry_policy: RetryPolicy)

What every HttpClient shares.

Attributes

NameTypeDescription
settingsOvokSettingsThe client's settings.
credentialsCredentialsSupplies the bearer token.
retry_policyRetryPolicyDecides when to retry.

HttpClient

HttpClient(context: HttpContext, base_path: str = '')

JSON over the Ovok API: bearer auth, one refresh after a 401, and retries for safe requests.

Parameters

NameTypeDefaultDescription
contextHttpContextSettings, credentials and retry policy.
base_pathstr''Path every request is relative to.

under()

under(path: str) -> HttpClient

Return a client whose requests are relative to path under this one.

anonymous()

anonymous() -> HttpClient

Return a client that sends no credentials.

get()

get(path: str) -> Any

Send a GET; see send.

post()

post(path: str, body: Any = None) -> Any

Send a POST with an optional JSON body; see send.

put()

put(path: str, body: Any) -> Any

Send a PUT with a JSON body; see send.

patch()

patch(path: str, body: Any) -> Any

Send a PATCH with a JSON body; see send.

delete()

delete(path: str) -> Any

Send a DELETE; see send.

send()

send(request: HttpRequest) -> Any

Send request with auth, retries and one refresh after a 401.

Returns

  • Any: The parsed JSON body, or None when it is empty.

Raises

  • OvokError: The subclass for the response status, or OvokConnectionError.

Last updated on

On this page