簡體   English   中英

即使提供了Pingdom憑據,

[英]Pingdom Credential Missing Even If Provided

我正在編寫一個向pingdom發出get請求的node.js應用程序; 但即使我嘗試將其放置在任何地方,也要不斷收到“用戶憑證丟失錯誤”。 請參見下面的代碼。

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();
}

只要自己回答即可,這樣就不會懸而未決...

pingdom使用http基本身份驗證,因此它必須位於身份驗證標頭中

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM