From 1972a5ca468def381e5b3763da4bf89ebaf05f69 Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Tue, 8 Mar 2022 13:36:26 -0500 Subject: [PATCH] added upload vscode test --- src/test/vscode/createNode.http | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/test/vscode/createNode.http diff --git a/src/test/vscode/createNode.http b/src/test/vscode/createNode.http new file mode 100644 index 0000000..99f9ed1 --- /dev/null +++ b/src/test/vscode/createNode.http @@ -0,0 +1,53 @@ +@baseUrl = http://localhost:8080/alfresco +@username = admin +@password = admin + +### Find Folder +# @name find +POST {{baseUrl}}/api/-default-/public/search/versions/1/search HTTP/1.1 +Authorization: Basic {{username}}:{{password}} + +{ + "query": { + "language": "afts", + "query": "=@cm:name:'Shared'" + } +} + +@folderNodeId = {{find.response.body.list.entries[0].entry.id}} + +### Upload File +# @name upload +POST {{baseUrl}}/api/-default-/public/alfresco/versions/1/nodes/{{folderNodeId}}/children?autoRename=true +Authorization: Basic {{username}}:{{password}} +Content-type: application/json + +{ + "name": "TestFolder", + "nodeType": "cm:content", + "properties": null +} + +### Upload File +# @name upload-form +POST {{baseUrl}}/api/-default-/public/alfresco/versions/1/nodes/{{folderNodeId}}/children +Authorization: Basic {{username}}:{{password}} +Content-type: multipart/form-data; boundary=----Test + +------Test +Content-disposition: form-data; name="name" + +TestFolder +------Test +Content-disposition: form-data; name="nodeType" + +cm:content +------Test +Content-disposition: form-data; name="autoRename" + +true +------Test +Content-disposition: form-data; name="filedata"; filename="test.txt" + +This is a test +------Test-- \ No newline at end of file