From cd5974adfba622ffc45df5844e38f1871ae1396e Mon Sep 17 00:00:00 2001 From: Fernando Aureliano da Silva Maia Date: Mon, 23 Oct 2023 18:31:48 -0300 Subject: [PATCH] update request_cookies function --- tokendito/user.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tokendito/user.py b/tokendito/user.py index 404a0bfa..955964c6 100644 --- a/tokendito/user.py +++ b/tokendito/user.py @@ -1217,18 +1217,7 @@ def request_cookies(url, session_token): logger.debug(f"Requesting session cookies from {url}") # Use the HTTP client to make a POST request. - response = HTTP_client.post(url, json=data, headers=headers) - - # Handle response errors if necessary - if response.status_code != 200: - logger.error( - f"Error making request to {url}. " - f"Status code: {response.status_code}. " - f"Response: {response.text}" - ) - sys.exit(1) - - response_json = response.json() + response_json = HTTP_client.post(url, json=data, headers=headers, return_json=True) if "id" not in response_json: logger.error(f"'id' not found in response. Full response: {response_json}")