Skip to content

Commit

Permalink
Changed creation kwargs with params for requests module
Browse files Browse the repository at this point in the history
  • Loading branch information
timerke committed Aug 28, 2024
1 parent aeb42bc commit 670be08
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions redminelib/engines/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ def construct_request_kwargs(self, method, headers, params, data):
:param data: (required). Data to send in the body of the request.
:type data: dict, bytes or file-like object
"""
kwargs = {'data': data or {}, 'params': params or {}, 'headers': headers or {}}

kwargs = dict(self.requests, **{'data': data or {}, 'params': params or {}, 'headers': headers or {}})

if method in ('post', 'put', 'patch') and 'Content-Type' not in kwargs['headers']:
kwargs['data'] = json.dumps(data)
kwargs['headers']['Content-Type'] = 'application/json'
if getattr(self.session, "timeout", None) is not None:
kwargs["timeout"] = self.session.timeout
return kwargs

def request(self, method, url, headers=None, params=None, data=None):
Expand Down

0 comments on commit 670be08

Please sign in to comment.