-
-
Notifications
You must be signed in to change notification settings - Fork 7
4. Objects
Objects that are stored in Kvpbase are stored within a container, which is stored as a subordinate to the user.
Objects are accessed using URLs of the form /[userguid]/[container]/[key]
.
To create an object, set the Content-Type
header and submit the object's body in a POST. If you'd like to add tags to an object, add ?tags=<tag1>,<tag2>
to the querystring.
POST /[userguid]/[container]/[key]
Content-Type: text/plain
Request:
Hello, world!
Response:
201/Created
To retrieve an object, use GET.
POST /[userguid]/[container]/[key]
Response:
Hello, world!
To write a range of bytes to an object, use PUT, and set the starting position in the querystring using index=n
.
PUT /[userguid]/[container]/[key]?index=0
Request:
Howdy
Response:
200/Ok
To read a range of bytes from an object, use GET, and set the starting position and number of bytes to retrieve in the querystring using index=n&count=n
.
GET /[userguid]/[container]/[key]?index=0&count=5
Response:
Howdy
To update an object's tags, use PUT with ?tags=<tag1>,<tag2>
in the querystring.
PUT /[userguid]/[container]/[key]?tags=foo,bar
Response:
200/Ok
To delete an object, use DELETE.
DELETE /[userguid]/[container]/[key]
Response:
204/No Data