更新时间:2022-01-28 09:08:52
如果您的服务器需要HTTP基本身份验证,我可以想到两个选项:
If your server requires HTTP Basic Authentication, there are two options I can think of:
ftp:// username:password @ url
options.headers = {'Authorization':base64('username'+':'+'password')};
li> ftp://username:password@url
options.headers = {'Authorization': base64('username' + ':' + 'password') };
请注意,base64必须是一个编码如下所示凭证的函数:
Note that base64 must be a function that encodes the credentials like this:
base64= function(credentials) {
var hash = btoa(credentials);
return "Basic " + hash;
};