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?