import requests


def _request(url: str, token: str, params: dict) -> requests.Response:
    """
    Creates a request for the Species+/CITES checklist API and handles
    HTTP exceptions.

    Parameters
    ----------
    url
        Species+/CITES checklist API endpoint.
    token
        Species+/CITES checklist API authentication token.
    params
        Request parameters.

    Returns
    -------
    requests.Response
        Request response.

    """
    headers = {"X-Authentication-Token": token}
    try:
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()
    except requests.exceptions.HTTPError as err:
        raise Exception(f"Error calling Species+ API. {err}")

    return response