import base64


def get_headers(username, password):
    """Formats the header to contain username and password variables """
    login_string = "{}:{}".format(username, password)

    # Python 2.7 and 3.6 support
    base64_login = base64.b64encode(str.encode(login_string))
    str_base64_login = base64_login.decode("utf-8")

    return {
        "Authorization": "Basic {}".format(str_base64_login),
        "Content-Type": "application/x-www-form-urlencoded",
        "Cache-Control": "no-cache"
    }