无法使用node.js访问BigCommerce WebDAV
如果我通过Cyberduck访问BigCommerce WebDAV,事情实际上是可行的。但是,我希望以编程方式完成这项工作。因此,我编写了以下代码:无法使用node.js访问BigCommerce WebDAV,node.js,bigcommerce,webdav,Node.js,Bigcommerce,Webdav,如果我通过Cyberduck访问BigCommerce WebDAV,事情实际上是可行的。但是,我希望以编程方式完成这项工作。因此,我编写了以下代码: const { createClient } = require("webdav"); async function run() { const client = createClient( "https://mystore.mybigcommerce.com/dav", { u
const { createClient } = require("webdav");
async function run() {
const client = createClient(
"https://mystore.mybigcommerce.com/dav",
{
username: "myemail@email.com",
password: "mypassword"
}
);
const contents = await client.getDirectoryContents("/");
}
run();
这是我获取目录内容的代码。我是从你那里抄来的。我从BigCommerce网站复制了电子邮件和密码
计算机返回(节点:32672)未经处理的PromisejectionWarning:错误:运行脚本后,请求失败,状态代码401
如果我在web浏览器中输入URL并输入正确的用户名和密码,它将返回以下内容:
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\NotImplemented</s:exception>
<s:message>
There was no plugin in the system that was willing to handle this GET method. Enable the Browser plugin to get a better result here.
</s:message>
</d:error>
Sabre\DAV\Exception\NotImplemented
系统中没有插件愿意处理这个GET方法。在此处启用浏览器插件以获得更好的结果。
希望你们能知道发生了什么,谢谢。你们需要一个支持Digest Auth的客户端,而不仅仅是Basic。似乎有人在讨论向您正在使用的WebDAV客户端添加摘要支持。此PR可能是一个良好的起点: