scopesim.server.download_utils.send_get

Contents

scopesim.server.download_utils.send_get#

scopesim.server.download_utils.send_get(client: Client, sub_url: str, stream: bool = False, params: dict | None = None) Response#

Send a GET request (streamed or not) using an existing client.

The point of this function is mostly elaborate exception handling.

Parameters:
  • client (httpx.Client) – Client instance.

  • sub_url (str) – Sub-URL to be appended to client.base_url.

  • stream (bool, optional) – Whether to stream the response. The default is False.

  • params (dict | None, optional) – Any query parameters to include in the URL. The default is None.

Raises:

ServerError – Raised if any error occurs during the process.

Returns:

response – Server response.

Return type:

httpx.Response