API referencehttp
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
| Name | Type | Description |
|---|---|---|
settings | OvokSettings | The client's settings. |
credentials | Credentials | Supplies the bearer token. |
retry_policy | RetryPolicy | Decides 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
| Name | Type | Default | Description |
|---|---|---|---|
context | HttpContext | Settings, credentials and retry policy. | |
base_path | str | '' | Path every request is relative to. |
under()
under(path: str) -> HttpClientReturn a client whose requests are relative to path under this one.
anonymous()
anonymous() -> HttpClientReturn a client that sends no credentials.
get()
get(path: str) -> AnySend a GET; see send.
post()
post(path: str, body: Any = None) -> AnySend a POST with an optional JSON body; see send.
put()
put(path: str, body: Any) -> AnySend a PUT with a JSON body; see send.
patch()
patch(path: str, body: Any) -> AnySend a PATCH with a JSON body; see send.
delete()
delete(path: str) -> AnySend a DELETE; see send.
send()
send(request: HttpRequest) -> AnySend 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, orOvokConnectionError.
Last updated on