def make_rest_call(
    url,
    method,
    azure_function_name,
    headers=None,
    params=None,
    payload=None,
    ssl_cert_path=True,
    proxies=None,
):
    """To make rest api calls to MS Sentinel rest api.

    Args:
        url (String): URL of the rest call.
        method (String): HTTP method of rest call. Eg. "GET", etc.
        headers (Dict, optional): headers. Defaults to None.
        params (Dict, optional): parameters. Defaults to None.
        payload (Type : As required by the rest call, optional): body. Defaults to None.
        ssl_cert_path (bool, optional): path to the certificate if True. Defaults to False.

    Returns:
        response : response of the rest call.
    """
    __method_name = inspect.currentframe().f_code.co_name
    error_log = "{}(method={}) : {}: {}"
    response_error_log = "{}(method={}) : {}: url: {}, Status Code : {}: {}"
    try:
        applogger.debug(
            "{}(method={}) : {}: Calling url: {}".format(
                LOGS_STARTS_WITH, __method_name, azure_function_name, url
            )
        )
        response = requests.request(
            method=method,
            url=url,
            headers=headers,
            params=params,
            data=payload,
            verify=ssl_cert_path,
            proxies=proxies,
        )
        if response.status_code >= 200 and response.status_code <= 299:
            applogger.debug(
                "{}(method={}) : {}: got the response from url : {} : Status code : {}".format(
                    LOGS_STARTS_WITH,
                    __method_name,
                    azure_function_name,
                    url,
                    response.status_code,
                )
            )
        elif response.status_code >= 400 and response.status_code <= 499:
            log_message = "error occurred while calling url."
            applogger.error(
                response_error_log.format(
                    LOGS_STARTS_WITH,
                    __method_name,
                    azure_function_name,
                    url,
                    response.status_code,
                    log_message,
                )
            )
        elif response.status_code == 500:
            log_message = "Internal Server Error"
            applogger.error(
                response_error_log.format(
                    LOGS_STARTS_WITH,
                    __method_name,
                    azure_function_name,
                    url,
                    response.status_code,
                    log_message,
                )
            )
        else:
            log_message = "Unexpected error occurred."
            applogger.error(
                response_error_log.format(
                    LOGS_STARTS_WITH,
                    __method_name,
                    azure_function_name,
                    url,
                    response.status_code,
                    log_message,
                )
            )
    except requests.ConnectionError as error:
        applogger.error(
            error_log.format(
                LOGS_STARTS_WITH, __method_name, azure_function_name, error
            )
        )
        raise CofenseException()
    except requests.HTTPError as error:
        applogger.error(
            error_log.format(
                LOGS_STARTS_WITH, __method_name, azure_function_name, error
            )
        )
        raise CofenseException()
    except requests.RequestException as error:
        applogger.error(
            error_log.format(
                LOGS_STARTS_WITH, __method_name, azure_function_name, error
            )
        )
        raise CofenseException()
    except CofenseException as error:
        applogger.error(
            error_log.format(
                LOGS_STARTS_WITH, __method_name, azure_function_name, error
            )
        )
        raise CofenseException()
    # To do: check the flow of return statement.
    return response
To make rest api calls to MS Sentinel rest api.

    Args:
        url (String): URL of the rest call.
        method (String): HTTP method of rest call. Eg. "GET", etc.
        headers (Dict, optional): headers. Defaults to None.
        params (Dict, optional): parameters. Defaults to None.
        payload (Type : As required by the rest call, optional): body. Defaults to None.
        ssl_cert_path (bool, optional): path to the certificate if True. Defaults to False.

    Returns:
        response : response of the rest call.
    
Solutions/CofenseTriage/Data Connectors/CofenseTriageDataConnector/SharedCode/utils.py