import logging
import requests


def request(url: str, encoding="utf-8"):
    """
    Small request GET method. Returns string.
    :param url: str
    :param encoding: str
    :return: str
    """
    logging.info("Requesting Url %s", url)
    response = requests.get(url=url)
    logging.info("Request finished with status code %d", response.status_code)
    response.raise_for_status()
    content = response.content

    if isinstance(content, bytes):
        return content.decode(encoding)

    return content