当我尝试使用以下代码通过摘要身份验证进行访问时,出现了未授权错误。但是,当我尝试在Postman上发出请求时,它运行良好。
var options = {
method: 'POST',
uri: this._uri,
auth: {
user: 'vv',
pass: 'pass',
sendImmediately: false
}
body: {
method: procedureName,
params: postParams,
id: 'jsonrpc',
},
json: true
};
request(
options,
function (error, response, body) {
// body is the decompressed response body
}
);