Wiki

Clone wiki

webfs / Docs / data

Data interface

The data interface ("http://p-static.net/webfs/data/1.0") allows you to use the GET, PUT, and DELETE HTTP methods to read, write, and delete data objects. The rest of this page assumes that DATA_URL is the root URL of the module that implements the data interface, and PATH is the path which follows DATA_URL.

GET

Fetches the contents of the data object stored at PATH.

HTTP response codes:

  • 200 OK: The object was found, and is being returned
  • 400 Bad Request: The specified path is invalid.
  • 404 Not Found: The object does not exist.

PUT

Sets the contents of the data object at PATH to the data sent on the request stream.

HTTP response codes:

  • 201 Created: The data was successfully stored, and no existing data was replaced.
  • 204 No Content: The data was successfully stored, and the existing file was replaced.
  • 400 Bad Request: The requested path was invalid.

DELETE

Deletes the data object at PATH.

HTTP response codes:

  • 204 No Content: The data was deleted successfully.
  • 400 Bad Request: The requested path was invalid.
  • 404 Not Found: No data object with the given path exists.

Updated