JSON documents live in MongoDB, so they get an _id. Files live in GridFS under a bucket and key of your choosing.
| Action | HTTP | Payload | URL | Description |
|---|---|---|---|---|
| Create | POST | json | /rest/<resource> | Create an entity represented by the JSON payload. |
| Read | GET | - | /rest/<resource> | Get all entities from the resource. |
| Query | GET | - | /rest/<resource>?filter=<json>&sort=<json>&limit=<n>&skip=<n> | Filter, sort and page. All four are optional. |
| Delete | DELETE | - | /rest/<resource> | Delete a resource. |
| Read | GET | - | /rest/<resource>/<id> | Get a single entity. |
| Update | PUT | json | /rest/<resource>/<id> | Update an entitiy with the JSON payload. |
| Delete | DELETE | - | /rest/<resource>/<id> | Delete an entity. |
| Action | HTTP | Payload | URL | Description |
|---|---|---|---|---|
| Upload | PUT | raw bytes | /files/<bucket>/<key> | Store the request body under the key. Content-Type is remembered. Overwrites. |
| Download | GET | - | /files/<bucket>/<key> | Get the bytes back with the stored Content-Type. |
| Delete | DELETE | - | /files/<bucket>/<key> | Delete a file. |
| List | GET | - | /files/<bucket> | List files in the bucket with size and Content-Type. |
| Delete | DELETE | - | /files/<bucket> | Delete a bucket and everything in it. |
| List | GET | - | /files | List all buckets. |