import base64


def _generate_server_header(username, password):
    """
    Get header for iMath REST API.

    Parameters
    ----------
    username : str
        username for iMath REST API
    password : str
        password for iMath REST API

    Returns
    -------
    dict
        header for iMath REST API

    """
    auth_string = "{}:{}".format(username, password)
    auth_string_b64 = base64.b64encode(auth_string.encode()).decode()
    return {
        "Authorization": "Basic {}".format(auth_string_b64)
    }