Skip to content

Commit c6c91c8

Browse files
justinpolygonjbonzo
authored andcommitted
Added response headers too
1 parent 284e49f commit c6c91c8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

polygon/rest/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ def _get(
9191
print_headers["Authorization"] = print_headers["Authorization"].replace(
9292
self.API_KEY, "REDACTED"
9393
)
94-
print(f"Full URL: {full_url}")
95-
print(f"Headers: {print_headers}")
94+
print(f"Request URL: {full_url}")
95+
print(f"Request Headers: {print_headers}")
9696

9797
resp = self.client.request(
9898
"GET",
@@ -102,6 +102,10 @@ def _get(
102102
headers=headers,
103103
)
104104

105+
if self.trace:
106+
resp_headers_dict = dict(resp.headers.items())
107+
print(f"Response Headers: {resp_headers_dict}")
108+
105109
if resp.status != 200:
106110
raise BadResponse(resp.data.decode("utf-8"))
107111

0 commit comments

Comments
 (0)