1

I'm writing a node.js application that makes a get request to pingdom; 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();
}
Max
  • 1,399
  • 13
  • 28
  • Ok solved, looked into the source code of a pingdom wrapper – Max Apr 26 '12 at 19:58
  • https://github.com/ryanbreen/node-pingdom/blob/master/lib/pingdom.js – Max Apr 26 '12 at 19:59
  • honestly i don't know why pingdom just provide a sample httpheader, which would be much extremely easy to provide and to read. – Max Apr 26 '12 at 19:59

1 Answers1

1

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

Max
  • 1,399
  • 13
  • 28