REST API - rsanchez-wsu/jfiles GitHub Wiki

A REST API would corresponds nicely with how a file browser works. There are 4 basic operations; create, read, update, and delete (CRUD!!). Translating that into a REST API should be relatively straight forward.

I've created a table of API methods and their expected HTTP return values.

Method Collection Item
Create 201, 404 for fail, 409 for conflict 201, 404 for fail, 409 for conflict
Read 200 returns list in XML,404 if not found 200 return XML, 404 if not found
Update/Replace 404, not valid? 200, 204 for NULL, 404 if not found
Update/Modify 200, 404 if not found 200, 204 for NULL, 404 if not found
Delete 200, 404 if not found 200, 404 if not found

The primary focus right now should be on the read portion of the API. If we have time later we can begin to work on other parts. It's important that we blueprint what we want now so that the path forward is clearer. Regarding the question marked items, I'm not sure if we want to allow update a replace to happen on a collection. It's possible to replace the contents of an entire folder in most operating systems. This task may be better achieved from the client side.

Also, the difference between update/replace and update/modify. The former would upload the actual file. The later would modify the metadata. If a new file is uploaded the client would first make a create request, wait for the return code (201), and then make an update/replace request to actually move the contents of the file.