diff --git a/openmeteo_requests/Client.py b/openmeteo_requests/Client.py index d12c16d..bb9d4be 100644 --- a/openmeteo_requests/Client.py +++ b/openmeteo_requests/Client.py @@ -21,13 +21,14 @@ class Client: def __init__(self, session: TSession | None = None): self.session = session or requests.Session() - def _get(self, cls: type[T], url: str, params: any, method: str) -> list[T]: + # pylint: disable=too-many-arguments + def _get(self, cls: type[T], url: str, params: any, method: str, verify: bool | str | None) -> list[T]: params["format"] = "flatbuffers" if method.upper() == "POST": - response = self.session.request("POST", url, data=params) + response = self.session.request("POST", url, data=params, verify=verify) else: - response = self.session.request("GET", url, params=params) + response = self.session.request("GET", url, params=params, verify=verify) if response.status_code in [400, 429]: response_body = response.json() @@ -46,9 +47,11 @@ def _get(self, cls: type[T], url: str, params: any, method: str) -> list[T]: pos += length + 4 return messages - def weather_api(self, url: str, params: any, method: str = "GET") -> list[WeatherApiResponse]: + def weather_api( + self, url: str, params: any, method: str = "GET", verify: bool | str | None = None + ) -> list[WeatherApiResponse]: """Get and decode as weather api""" - return self._get(WeatherApiResponse, url, params, method) + return self._get(WeatherApiResponse, url, params, method, verify) def __del__(self): """cleanup"""