Skip to content

flywheel.rest

ApiException

Bases: Exception

__str__()

Custom error messages for exception

RESTClientObject

Bases: object

request(method, url, query_params=None, headers=None, body=None, post_params=None, _preload_content=True, _request_timeout=None)

Perform requests.

Parameters:

Name Type Description Default
method

http request method

required
url

http request url

required
query_params

query parameters in the url

None
headers

http request headers

None
body

request json body, for application/json

None
post_params

request post parameters, application/x-www-form-urlencoded and multipart/form-data

None
_preload_content

if False, the streaming response will be returned without reading/decoding response data. Default is True.

True
_request_timeout

timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

None

RESTResponse

Bases: IOBase

getheader(name, default=None)

Returns a given response header.

getheaders()

Returns a dictionary of the response headers.

RetryTransport

Bases: BaseTransport

Wraps an httpx2 transport and retries transient HTTP status codes and connection errors with exponential backoff.

Replaces the urllib3 Retry/HTTPAdapter behaviour from the requests-based client. By default it retries at 0.0s, 1.875s, 3.75s, 7.5s, 15s, 30s, 60s after the request: sleep is 0 on the 1st retry, then backoff_factor * 2 ** retry. A Retry-After response header, when present, takes precedence.

StreamedResponse

Bases: object

A requests-like adapter over a streaming httpx2 response.

Returned when _preload_content=False so existing call sites can keep using iter_content, raw, encoding and close.