Obtaining a client
Internally, zds-client is used to resolve remote API objects where the API is documented using OpenAPI 3 specifications.
Subclasses of the base
Client class can also be used, in a pluggable fashion. By
default, the base class is used in combination with
CUSTOM_CLIENT_FETCHER is a string with the dotted path to a callable
taking a single
url string argument. The callable should return a ready-to-use
client instance for that particular URL, or
None if no suitable client can be
Interface to get a zds_client object for a given URL.
- vng_api_common.client.get_client(url: str, url_is_api_root=False) Optional[zds_client.client.Client]
Get a client instance for the given URL.
If the setting CUSTOM_CLIENT_FETCHER is defined, then this callable is invoked. Otherwise we fall back on the default implementation.
If no suitable client is found,