def get_request_value(req, key):
    """
    Return the value of the request object's JSON dictionary.
    """
    request_json = req.get_json()
    if req.args and key in req.args:
        return req.args.get(key)
    elif request_json and key in request_json:
        return request_json[key]
    else:
        return None