import requests


def curl(url, data=None, method='get'):
    """Download one file from a web URL. The request is stateless, just like
    what the cURL tool would do.

    Args:
        url (str): URL to request
        data (dict): data to pass on into the request, such as the post body
        method (str): one of the six HTTP methods, "get", "put", "post",
                      "delete", "head", "options"
    Returns:
        requests.response object. We can get the content in binary or text using
        response.content or response.text respectively
    """
    assert method in ["get", "put", "post", "delete", "head", "options"]
    requestfunction = getattr(requests, method)
    params = {}
    if data:
        params["data"] = data
    return requestfunction(url, **params)