pi_portal.modules.integrations.network.http

Network utilities for the Pi Portal Project.

class pi_portal.modules.integrations.network.http.HttpClient(log)[source]

Remote HTTP server client.

Parameters:

log (Logger) – A logging instance.

get(url, target=None)[source]

Fetch a remote URL and save to a local file system target.

Parameters:
  • url (str) – The remote URL to fetch.

  • target (Optional[str], default: None) – The local path to write the content to.

Return type:

Response

Returns:

The http response object.

exception pi_portal.modules.integrations.network.http.HttpClientError[source]

Raised when the HTTP client encounters an error.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.