[英]Pingdom Credential Missing Even If Provided
I'm writing a node.js application that makes a get request to pingdom; 我正在编写一个向pingdom发出get请求的node.js应用程序; but keep getting "user credential missing error" even tho I tried to put that everywhere. 但即使我尝试将其放置在任何地方,也要不断收到“用户凭证丢失错误”。 Please see code below. 请参见下面的代码。
function get_checks() {
var options = {
"hostname" : "api.pingdom.com",
"path" : "/api/2.0/checks?"+"userpwd=user@example.com"+":"+"password",
"method" : "GET",
"headers" : {
"userpwd" : "user@example.com"+":"+"password",
"App-Key" : "key"
},
"userpwd" : "user@example.com"+":"+"password"
};
var req = https.request(options, function(response){
response.on('data', function(response_data) {
console.log("Response: " + response_data);
});
});
req.end();
}
Just gonna answer this myself so it doesn't hang as an unanswered question... 只要自己回答即可,这样就不会悬而未决...
pingdom uses http basic authentication so it has to be in authentication header pingdom使用http基本身份验证,因此它必须位于身份验证标头中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.