aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pyfunkwhale/client.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pyfunkwhale/client.py b/pyfunkwhale/client.py
index 4372460..95907f7 100644
--- a/pyfunkwhale/client.py
+++ b/pyfunkwhale/client.py
@@ -91,7 +91,7 @@ class Client(object):
return self.call('/token', 'post', data=data).json()
def call(self, endpoint: str, method: str, params: dict = None,
- data: dict = None) -> Response:
+ data: dict = None, headers: dict = None) -> Response:
"""
Call the API
@@ -112,8 +112,9 @@ class Client(object):
If their is an error during requesting the API.
"""
self._refresh_token()
- headers = {'Authorization': self.token['token_type'] + ' ' +
- self.token['access_token']}
+ if headers is None:
+ headers = {'Authorization': self.token['token_type'] + ' ' +
+ self.token['access_token']}
call = getattr(self.oauth_client, method)