24 from rapp_utilities
import RappUtilities
25 from rapp_exceptions
import RappError
64 if url_add
is not None:
66 param = self._params.copy()
67 if params_dict
is not None:
68 param.update(params_dict)
69 head = self._headers.copy()
70 if headers_dict
is not None:
71 head.update(headers_dict)
74 response = requests.get(url, params=param,
76 except requests.RequestException
as err:
77 RappUtilities.rapp_print(err,
'ERROR')
79 RappUtilities.rapp_print(
'URL: ' + response.url,
'DEBUG')
87 error =
'Request error. Status code: ' + str(response.status_code)
88 RappUtilities.rapp_print(error,
'ERROR')
89 raise RappError(error)
100 return response.json()
101 except ValueError
as err:
102 RappUtilities.rapp_print(err,
'ERROR')
105 return response.text()
_server_timeout
Seconds to wait for any server response.
def perform_request
Execute the request and verify response.
_headers
The request additional headers.
_response_format
The required response format.
def _modify_response
Return the proper response format.
_accepted_status
The value of valid response status code.
_params
The request parameters.