コード例 #1
0
def set(key, value):
    header = {}
    if isinstance(value, int) or isinstance(value, float):
        header['type'] = 'NUM'
    elif isinstance(value, str):
        header['type'] = "STR"
    else:
        header['type'] = "STR"

    controller.send_request("POST", key, header, str(value))
コード例 #2
0
def delete(key):
    controller.send_request("DELETE", key)
コード例 #3
0
def decrement(key):
    header = {'op': 'DECR'}
    controller.send_request("PUT", key, header)
コード例 #4
0
def get(key):
    return controller.send_request("GET", key).decode("utf-8")