import requests


def delete_request(test_data):
    """ execute DELETE request given arguments

    Args:
        test_data(dict): parameters to to create the request

    Returns:
        server response
    """
    if test_data['payload_is_json']:
        return requests.delete(test_data['url'],
                               json=test_data['payload'],
                               verify=False,
                               cookies=test_data['cookies'])
    else:
        return requests.delete(test_data['url'],
                               data=test_data['payload'],
                               verify=False,
                               cookies=test_data['cookies'])