diff --git a/src/dataclass_rest/boundmethod.py b/src/dataclass_rest/boundmethod.py index c57a222..8fb7b6a 100644 --- a/src/dataclass_rest/boundmethod.py +++ b/src/dataclass_rest/boundmethod.py @@ -74,6 +74,7 @@ def _create_request( data=data, files=files, url=url, + headers={}, ) def get_query_params_type(self) -> Type: diff --git a/src/dataclass_rest/http/aiohttp.py b/src/dataclass_rest/http/aiohttp.py index a8e2d60..833ec80 100644 --- a/src/dataclass_rest/http/aiohttp.py +++ b/src/dataclass_rest/http/aiohttp.py @@ -79,6 +79,7 @@ async def do_request(self, request: HttpRequest) -> Any: json=json, data=data, params=request.query_params, + headers=request.headers, ) except AioHttpClientError as e: raise ClientLibraryError from e diff --git a/src/dataclass_rest/http/requests.py b/src/dataclass_rest/http/requests.py index f8c58a8..70ed560 100644 --- a/src/dataclass_rest/http/requests.py +++ b/src/dataclass_rest/http/requests.py @@ -69,6 +69,7 @@ def do_request(self, request: HttpRequest) -> Any: json=json, params=request.query_params, data=data, + headers=request.headers, files=files, ) except RequestException as e: diff --git a/src/dataclass_rest/http_request.py b/src/dataclass_rest/http_request.py index b7ba4e0..8ea441e 100644 --- a/src/dataclass_rest/http_request.py +++ b/src/dataclass_rest/http_request.py @@ -14,6 +14,7 @@ class HttpRequest: is_json_request: bool data: Any files: Dict[str, File] - query_params: Dict + query_params: Dict[str, Any] + headers: Dict[str, str] url: str method: str