import requests def call_api(api_url, method, params): """ Function to make an API call. Parameters: - api_url (str): The URL of the API endpoint. - method (str): The HTTP method to use ('POST' or 'GET'). - params (dict): Dictionary of parameters. Returns: - response: The response from the API call. """ print("Calling API",api_url,"with method",method,"and parameters",params) if method.upper() == 'POST': response = requests.post(api_url, data=params, verify=False) elif method.upper() == 'GET': response = requests.get(api_url, params=params, verify=False) else: raise ValueError("Method must be 'POST' or 'GET'") return response