Skip to content

Commit 5b2b84f

Browse files
committed
Don't use getattr to figure out which Requests method to use
1 parent 87834c7 commit 5b2b84f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

upcloud_api/cloud_manager/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ def request(self, method, endpoint, body=None, params=None, timeout=-1, request_
4646

4747
call_timeout = timeout if timeout != -1 else self.timeout
4848

49-
APIcall = getattr(requests, method.lower())
50-
res = APIcall(url, data=data, params=params, headers=headers, timeout=call_timeout)
49+
res = requests.request(
50+
method=method, url=url, data=data, params=params, headers=headers, timeout=call_timeout
51+
)
5152

5253
if res.text:
5354
res_json = res.json()

0 commit comments

Comments
 (0)