api_client
GalileoApiClient Objects
A Client which has been authenticated for use on secured endpoints
The following are accepted as keyword arguments and will be used to construct httpx Clients internally:
base_url
: The base URL for the API, all requests are made to a relative path to this URL
This can also be set via the GALILEO_CONSOLE_URL environment variable
api_key
: The API key to be sent with every request
This can also be set via the GALILEO_API_KEY environment variable
cookies
: A dictionary of cookies to be sent with every request
headers
: A dictionary of headers to be sent with every request
timeout
: The maximum amount of a time a request can take. API functions will raise
httpx.TimeoutException if this is exceeded.
verify_ssl
: Whether or not to verify the SSL certificate of the API server. This should be True in production,
but can be set to False for testing purposes.
follow_redirects
: Whether or not to follow redirects. Default value is False.
httpx_args
: A dictionary of additional arguments to be passed to the httpx.Client
and httpx.AsyncClient
constructor.
Arguments:
- “0: Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor.
- “1: The token to use for authentication
- “2: The prefix to use for the Authorization header
- “3: The name of the Authorization header
with_api_key
Get a new client matching this one with a new API key
get_httpx_client
Get the underlying httpx.Client, constructing a new one if not previously set
get_async_httpx_client
Get the underlying httpx.AsyncClient, constructing a new one if not previously set