diff --git a/readme/api/references/rest_api.md b/readme/api/references/rest_api.md index 570c4b338..a53807e1a 100644 --- a/readme/api/references/rest_api.md +++ b/readme/api/references/rest_api.md @@ -331,6 +331,10 @@ Creating a new resource is special because you also need to upload the file. Unl curl -F 'data=@/path/to/file.jpg' -F 'props={"title":"my resource title"}' http://localhost:41184/resources +Or to **update** a resource: + + curl -X PUT -F 'data=@/path/to/file.jpg' -F 'props={"title":"my modified title"}' http://localhost:41184/resources/8fe1417d7b184324bf6b0122b76c4696 + The "data" field is required, while the "props" one is not. If not specified, default values will be used. **From a plugin** the syntax to create a resource is also a bit special: @@ -351,6 +355,8 @@ The "data" field is required, while the "props" one is not. If not specified, de Sets the properties of the resource with ID :id +You may also update the file data by specifying a file (See `POST /resources` example). + ## DELETE /resources/:id Deletes the resource with ID :id