From bdd9c6cf35e57349e66953de4c4bed13662f0018 Mon Sep 17 00:00:00 2001 From: Joplin Bot Date: Sat, 9 Apr 2022 12:19:45 +0000 Subject: [PATCH] Doc: Updated Markdown files Auto-updated using release-website.sh --- readme/api/references/rest_api.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/readme/api/references/rest_api.md b/readme/api/references/rest_api.md index a53807e1ab..0e7bd65d92 100644 --- a/readme/api/references/rest_api.md +++ b/readme/api/references/rest_api.md @@ -331,10 +331,14 @@ 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: +To **update** the resource content, you can make a PUT request with the same arguments: curl -X PUT -F 'data=@/path/to/file.jpg' -F 'props={"title":"my modified title"}' http://localhost:41184/resources/8fe1417d7b184324bf6b0122b76c4696 +Or if you only need to update the resource properties (title, etc.), without changing the content, you can make a regular PUT request: + + curl -X PUT --data '{"title": "My new 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: