Skip to content

client

Module to define base class for client.

This module defines base class for a client that can be used for any type of requests.

APITokenType module-attribute

APITokenType = Union[str, Callable[[], str]]

Client

Client(
    base_url,
    api_token,
    key_type,
    user_agent,
    timeout=None,
    proxies=None,
    retries=0,
    delay=1,
    request_body_extractor=None,
    response_processor=None,
    verify_ssl=False,
)

Blocking/synchronous client class.

client property

client

Returns httpx client.

Returns:

  • Client

    Httpx client.

cookies property

cookies

Returns cookies of httpx client.

Returns:

  • Cookies

    Cookies of httpx client

base_url property

base_url

Returns base url of httpx client.

Returns:

  • str

    Base url of httpx client

headers property

headers

Returns headers of httpx client.

Returns:

  • Dict

    Headers of httpx client

request

request(
    method,
    url,
    content=None,
    data=None,
    files=None,
    json=None,
    params=None,
    headers=None,
    cookies=None,
    timeout=None,
    follow_redirects=True,
    type_=None,
    parse_json=False,
    request_body=None,
)

Sends request with given parameters.