diff --git a/codeboxapi/utils.py b/codeboxapi/utils.py index 7f521c4..9269f3c 100644 --- a/codeboxapi/utils.py +++ b/codeboxapi/utils.py @@ -51,7 +51,7 @@ def handle_response(response: requests.Response): raise CodeBoxError( http_status=response.status_code, json_body=response.json(), - headers=response.headers.__dict__, + headers=dict(response.headers.items()), ) return handler(response) @@ -85,7 +85,7 @@ async def default_handler(r: ClientResponse) -> dict: raise CodeBoxError( http_status=response.status, json_body=await response.json(), - headers=response.headers.__dict__, + headers=dict(response.headers.items()), ) return await handler(response)