import requests


def getValue(url, key, prompt=None):
    """
    Get a value from the key-value store.
    """
    params = None
    if prompt:
        params = {'prompt': prompt}
    r = requests.get('%s/%s' % (url, key), params=params)
    if not r.ok:
        raise Exception("Request for %r failed: %r" % (key, r.text))
    return r.text