Skip to content

Commit 249a916

Browse files
authored
Updated patch and post methods to pass json arg instead of params
1 parent b0ff9b8 commit 249a916

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

github_api_toolkit/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def patch(self, url: str, params: dict = {}, add_prefix: bool = True) -> request
137137
"""
138138
if add_prefix:
139139
url = "https://api.github.com" + url
140-
return self.handle_response(requests.patch(url=url, headers=self.headers, params=params))
140+
return self.handle_response(requests.patch(url=url, headers=self.headers, json=params))
141141

142142
def post(self, url: str, params: dict = {}, add_prefix: bool = True) -> requests.Response | Exception:
143143
"""Performs a post request using the passed url.
@@ -154,4 +154,4 @@ def post(self, url: str, params: dict = {}, add_prefix: bool = True) -> requests
154154
"""
155155
if add_prefix:
156156
url = "https://api.github.com" + url
157-
return self.handle_response(requests.post(url=url, headers=self.headers, params=params))
157+
return self.handle_response(requests.post(url=url, headers=self.headers, json=params))

0 commit comments

Comments
 (0)