Wire Protocols
>
HTTP

HTTP

Pogocache uses HTTP methods PUT, GET, DELETE to store, retrieve, and delete entries.

Store entry

PUT /:key

Params

Param Required Description
key yes Key of entry
ttl no Time to live in seconds
nx no Only store if it does not already exist.
xx no Only store if it already exists.
auth no Auth password

Returns

  • 200 OK with the response "Stored"

Example

$ curl -X PUT -d "my value" "http://localhost:9401/mykey"
Stored

# Store with 15 second ttl
$ curl -X PUT -d "my value" "http://localhost:9401/mykey?ttl=15" 
Stored

Get entry

GET /:key

Params

Param Required Description
key yes Key of entry
auth no Auth password

Returns

  • 200 OK and the value in the body
  • 404 Not Found and the value "Not Found"

Example

$ curl -X PUT -d "my value" "http://localhost:9401/mykey"
Stored

$ curl "http://localhost:9401/mykey"
my value

Delete entry

DELETE /:key

Params

Param Required Description
key yes Key of entry
auth no Auth password

Returns

  • 200 OK with the respone "Deleted"
  • 404 Not Found and the value "Not Found"

Example

$ curl -X PUT -d "my value" "http://localhost:9401/mykey"
Stored

$ curl -X DELETE "http://localhost:9401/mykey"
Deleted