0
我正在写一个node.js应用程序,它使ping的获取请求;但即使是我试图把它放在任何地方,仍然不断收到“用户证书缺失错误”。请参阅下面的代码。Pingdom凭据即使如果提供
function get_checks() {
var options = {
"hostname" : "api.pingdom.com",
"path" : "/api/2.0/checks?"+"[email protected]"+":"+"password",
"method" : "GET",
"headers" : {
"userpwd" : "[email protected]"+":"+"password",
"App-Key" : "key"
},
"userpwd" : "[email protected]"+":"+"password"
};
var req = https.request(options, function(response){
response.on('data', function(response_data) {
console.log("Response: " + response_data);
});
});
req.end();
}
好解决,看着进入pingdom包装的源代码 – Max 2012-04-26 19:58:55
https://github.com/ryanbreen/node-pingdom/blob/master/lib/pingdom.js – Max 2012-04-26 19:59:01
老实说,我不知道为什么pingdom只提供一个样本httpheader,这将是非常容易提供和阅读。 – Max 2012-04-26 19:59:51