Skip to content

Commit

Permalink
New method "PUT" added.
Browse files Browse the repository at this point in the history
  • Loading branch information
rumen-vasilev committed Dec 22, 2024
1 parent 999cb6c commit 0aff806
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions qrs_api_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,23 @@ def post(self, endpoint: str, params: str = None, headers: dict = None, data=Non
headers = {}
return self._request(method="POST", endpoint=endpoint, params=params, headers=headers, data=data)

def put(self, endpoint: str, params: str = None, headers: dict = None, data=None) -> dict:
"""
Executes a PUT request to the QRS API.
Args:
endpoint (str): The API endpoint to call.
params (str, optional): Query parameters to include in the request.
headers (dict, optional): Additional header parameters.
data (dict or str, optional): The JSON payload to include in the request body.
Returns:
dict: JSON response as a dictionary or None if an error occurs.
"""
if headers is None:
headers = {}
return self._request(method="PUT", endpoint=endpoint, params=params, headers=headers, data=data)

def delete(self, endpoint: str, params: str = None) -> dict:
"""
Executes a DELETE request to the QRS API.
Expand Down

0 comments on commit 0aff806

Please sign in to comment.