Skip to content

Commit

Permalink
Merge pull request #40 from reagento/feature/headers
Browse files Browse the repository at this point in the history
Add headers to request model
  • Loading branch information
Tishka17 authored Aug 5, 2024
2 parents b3510bb + cc151e3 commit 9bb5665
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/dataclass_rest/boundmethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def _create_request(
data=data,
files=files,
url=url,
headers={},
)

def get_query_params_type(self) -> Type:
Expand Down
1 change: 1 addition & 0 deletions src/dataclass_rest/http/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions src/dataclass_rest/http/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion src/dataclass_rest/http_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9bb5665

Please sign in to comment.