From 0dc2f22e908b27aa5e53bac7a8213edc0f8557aa Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Sat, 1 Jun 2024 09:32:12 -0400 Subject: [PATCH] OGC API: capture response headers --- owslib/ogcapi/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/owslib/ogcapi/__init__.py b/owslib/ogcapi/__init__.py index ad1d29f6..4e77fc7b 100644 --- a/owslib/ogcapi/__init__.py +++ b/owslib/ogcapi/__init__.py @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2022 Tom Kralidis +# Copyright (c) 2024 Tom Kralidis # # Author: Tom Kralidis # @@ -55,6 +55,8 @@ def __init__(self, url: str, json_: str = None, timeout: int = 30, self.json_ = json_ self.timeout = timeout self.headers = REQUEST_HEADERS + self.response_headers = None + if headers: self.headers.update(headers) self.auth = auth @@ -188,6 +190,7 @@ def _request(self, method: str = 'GET', path: str = None, raise RuntimeError(response.text) self.request = response.url + self.response_headers = response.headers if as_dict: if len(response.content) == 0: