propfind

Webdav with curl vs Javascript

拜拜、爱过 提交于 2020-04-30 08:48:43
问题 I try to access a Nextcloud server using Webdav. Using curl this works: curl -X PROPFIND -u user:pwd https://nextcloudserver.com/remote.php/dav/files/user Using Javascript this I get a 503 error const url = "https://nextcloudserver.com/remote.php/dav/files/user/" var xhr = new XMLHttpRequest(); xhr.open('PROPFIND', url, true); xhr.setRequestHeader("Authorization", "Basic " + btoa("username:pwd")); xhr.withCredentials=true; xhr.send(); Any idea? 回答1: this is working for me: const url = "https:

Webdav with curl vs Javascript

[亡魂溺海] 提交于 2020-04-30 08:48:36
问题 I try to access a Nextcloud server using Webdav. Using curl this works: curl -X PROPFIND -u user:pwd https://nextcloudserver.com/remote.php/dav/files/user Using Javascript this I get a 503 error const url = "https://nextcloudserver.com/remote.php/dav/files/user/" var xhr = new XMLHttpRequest(); xhr.open('PROPFIND', url, true); xhr.setRequestHeader("Authorization", "Basic " + btoa("username:pwd")); xhr.withCredentials=true; xhr.send(); Any idea? 回答1: this is working for me: const url = "https: