Skip to content

Instantly share code, notes, and snippets.

@xquery
Last active July 29, 2021 06:36
Show Gist options
  • Save xquery/7643288 to your computer and use it in GitHub Desktop.
Save xquery/7643288 to your computer and use it in GitHub Desktop.
webdav the api you never knew existed
add file
curl -X PUT --anyauth --user 'admin:admin' -T cluster1.xml 'http://localhost:8005/testfile.xml'
make directory
curl -X MKCOL --anyauth --user 'admin:admin' 'http://localhost:8005/testdir'
move a file
curl -X MOVE --anyauth --user 'admin:admin' --header 'Destination: http://localhost:8005/testfile1.xml' 'http://localhost:8005/testfile.xml'
list all files in webdav
curl --anyauth --user 'admin:admin' -i -X PROPFIND http://localhost:8005/ --upload-file - -H "Depth: 100" <<end
<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:">
<a:prop><a:resourcetype/></a:prop>
</a:propfind>
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment