import requests
import json


def request_records(request_params):
    """
    Download utility rate records from USURDB given a set of request
    parameters.
    :param request_params: dictionary with request parameter names as
    keys and the parameter values
    :return:
    """
    records = requests.get(
        "https://api.openei.org/utility_rates?", params=request_params
    )
    request_content = records.content

    # strict=False prevents an error (control characters are allowed inside
    # strings)
    json_records = json.loads(request_content, strict=False)

    return json_records