Skip to content

Commit

Permalink
OGC API: capture response headers (#931)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis authored Jun 6, 2024
1 parent 44e3ece commit 6dfa506
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion owslib/ogcapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# =============================================================================
# Copyright (c) 2022 Tom Kralidis
# Copyright (c) 2024 Tom Kralidis
#
# Author: Tom Kralidis <[email protected]>
#
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 6dfa506

Please sign in to comment.