I want to create a REST API for a file upload service that allows a user to:
- Open a session
- Upload a bunch of files
- Close the session
And then later, come back and do things with the files they uploaded in a previous session.
To facilitate dealing with data about each file and dealing with the content of the file itself, this is the URI scheme I am thinking of using:
/sessions/
/sessions/3
/sessions/3/files
/sessions/3/files/5
/sessions/3/file/5/content
/sessions/3/file/5/metadata
This will allow the file metadata to be dealt with separately from the file content. In this case, only a GET is allowed on the file content and file metadata, and to update either one, a new file has to be PUT.
Does this make sense? If not, why and how could it be better?