RequestHandler

class core.zowe.core_for_zowe_sdk.RequestHandler(session_arguments, logger_name='core.zowe.core_for_zowe_sdk.request_handler')

Class used to handle HTTP/HTTPS requests.

session_arguments

Zowe SDK session arguments

Type:

dict

valid_methods

List of supported request methods

Type:

list

__del__()

Clean up the REST session object once it is no longer needed anymore

perform_request(method, request_arguments, expected_code=[200], stream=False)

Execute an HTTP/HTTPS requests from given arguments and return validated response (JSON).

Parameters:
  • method (str) – The request method that should be used

  • request_arguments (dict) – The dictionary containing the required arguments for the execution of the request

  • expected_code (int) – The list containing the acceptable response codes (default is [200])

  • stream (boolean) – The boolean value whether the request is stream

Returns:

normalized_response – normalized request response in json (dictionary)

Return type:

json