HTTP request generator.

def get_http(base_url, function, opts):
    """HTTP request generator."""
    url = (os.path.join(base_url, function) + '/?' + urlencode(opts))
    data = urlopen(url)

    if data.code != 200:
        raise ValueError("Random.rg returned server code: " + str(data.code))
    return data.read()