鍍金池/ 問答/C++  網(wǎng)絡(luò)安全  HTML/ nodejs https post 神奇bug

nodejs https post 神奇bug

app.post('/geterweima',function(req,res,next){

    var postData =  querystring.stringify({
        "path":req.body.path,
        "width":"430"
    });
    var options = {
        hostname:'api.weixin.qq.com',
        port:443,
        path:'/cgi-bin/wxaapp/createwxaqrcode?access_token='+ token,
        method:'POST',
          headers: {
              'Content-Type': 'application/x-www-form-urlencoded',
              'Content-Length': Buffer.byteLength(postData)
          }
    }
    var r = http.request(options, (s) => {
      console.log(s);    
      s.on('data', (chunk) => {
        console.log(chunk);
      });
      s.on('end', () => {
        console.log('響應中已無數(shù)據(jù)。');
      });
    });
    r.on('error', (e) => {
        console.log(e)
    });
    r.write(postData);
    r.end(); 

})

小程序端發(fā)起請求后 就返回個502 服務(wù)器端沒有任何錯誤提示!!!

接口為 獲取小程序分頁二維碼

token值是正確的

回答
編輯回答
糖果果

502 是服務(wù)端錯誤,一般是請求太多了處理不過來,你過一段時間再試試看。

2017年7月24日 08:36
編輯回答
嫑吢丕
2018年5月29日 23:54
編輯回答
玩控

服務(wù)器抓包調(diào)試 看錯誤日志分析啊

2018年8月2日 13:25