Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

4. Objects

Joel Christner edited this page Mar 30, 2020 · 4 revisions

Objects that are stored in Kvpbase are stored within a container, which is stored as a subordinate to the user.

Request URLs

Objects are accessed using URLs of the form /[userguid]/[container]/[key].

Creating an Object

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

Retrieving an Object

To retrieve an object, use GET.

POST /[userguid]/[container]/[key] 
Response:
Hello, world!

Writing a Range of Bytes to an Object

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

Reading a Range of Bytes from an Object

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

Updating an Object's Tags

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

Deleting an Object

To delete an object, use DELETE.

DELETE /[userguid]/[container]/[key]
Response:
204/No Data