Get value by key
Request:
GET /get?key HTTP/1.1
Response:
<value_len>\n
<value>
If the key does not exist in the database, the reply will be:
-1\n
Get values by keys
Request:
GET /mget?key1&key2&key3 HTTP/1.1
Response:
<key1>\n
<value1_len>\n
<value1>\n
<key2>\n
<value2_len>\n
<value2>\n
<key3>\n
<value3_len>\n
<value3>\n
If the keyN does not exist, then <valueN_len> = -1
, <valueN>
-- is empty
Set value by key
Request:
POST /set HTTP/1.1
Content-Length: <content_length>\r\n
\r\n
<key>\n
<value_len>\n
<value>
Response:
OK
If successful. And reply:
FAIL
on fail.
Set values by keys
Request:
POST /mset HTTP/1.1
Content-Length: <content_length>\r\n
\r\n
<key1>\n
<value1_len>\n
<value1>
<key2>\n
<value2_len>\n
<value2>
<key3>\n
<value3_len>\n
<value3>
Response:
OK
If successful. And reply:
FAIL
on fail.
Delete key from DB
Request:
POST /del HTTP/1.1
Content-Length: <content_length>\r\n
\r\n
<key>
Response:
OK
If successful. And reply:
FAIL
on fail.
Delete keys from DB
Request:
POST /mdel HTTP/1.1
Content-Length: <content_length>\r\n
\r\n
<key1>\n
<key2>\n
<key3>
Response:
OK
If successful. And reply:
FAIL
on fail.
Request:
GET /exist?key HTTP/1.1
Response:
OK
<value_len>\n
<value>
if the key exists and is able to retrieve its value.
Response:
OK
-1\n
if the key exists but was not able to retrieve its value.
Response:
FAIL
if the key does not exist in the database.
Imcrement value by key
Request:
POST /incr HTTP/1.1
Content-Length: <content_length>\r\n
\r\n
<key>
to increase the value on 1.
Or request:
POST /incr HTTP/1.1
Content-Length: <content_length>\r\n
\r\n
<key>\n
<value>
to increase the value on <value>
.
Response:
OK
If successful. And reply:
FAIL
on fail.
Request:
POST /tail
Response: the same as multi get
Request:
GET /prefit?<prefix>
Response: the same as multi get
Request:
GET /seekprev?<key-prefix-start>[&<starts-with>]
GET /seekprev-range?<key-prefix-start>&<key-prefix-end>[&<starts-with>]
GET /seeknext?<key-prefix-start>[&<starts-with>]
GET /seeknext-range?<key-prefix-start>&<key-prefix-end>[&<starts-with>]
seekprev
and seekprev-range
seeks for first key less then <key-prefix-start>
.
seeknext
and seeknext-range
seeks for first key equal or more then <key-prefix-start>
.
seekprev-range
and seeknext-range
iterate while key less or equal <key-prefix-end>
If optional parameter <starts-with>
given iterate, while key starts with prefix <starts-with>
Response: the same as multi get
Backup database
Request:
POST /backup
Response:
OK
If successful. Or reply:
<Error message>
on fail.
Usage statistics
Request:
GET /stats
Response: stats output