亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

getaddrinfo ENOTFOUND https://graph.facebook.com/

getaddrinfo ENOTFOUND https://graph.facebook.com/

鴻蒙傳說 2021-08-20 14:36:07
我正在使用 Nodehttps庫將數據發送到 Facebook API。我最終出現錯誤:getaddrinfo ENOTFOUND https://graph.facebook.com/ https://graph.facebook.com/:443我覺得很奇怪,因為使用 Postman 提出的相同請求毫無問題地通過了。我試過nslookup:$ nslookup https://graph.facebook.com/Server:     1.1.1.1Address:    1.1.1.1#53** server can't find https://graph.facebook.com/: NXDOMAIN不知道是什么原因造成的。這是我的帶有匿名令牌的代碼:var inputData = new Array;inputData.firstname = "First name";inputData.lastname = "Last name"inputData.phone = "Phone";inputData.email = "Email";inputData.workable_stage = "Applied";inputData.access_token = 'xxx';var https = require('https');var crypto = require('crypto'); // Facebook API requires hashing of user datavar querystring = require('querystring');const firstname_hash = crypto.createHash('sha256');const lastname_hash = crypto.createHash('sha256');const phone_hash = crypto.createHash('sha256');const email_hash = crypto.createHash('sha256');// hash user datafirstname_hash.update(inputData.firstname);var firstname_hashed = firstname_hash.digest('hex');lastname_hash.update(inputData.lastname);var lastname_hashed = lastname_hash.digest('hex');phone_hash.update(inputData.phone);var phone_hashed = phone_hash.digest('hex');email_hash.update(inputData.email);var email_hashed = email_hash.digest('hex');// prepare data objectvar fb_data = [  { match_keys:          {           "fn": firstname_hashed,           "ln": lastname_hashed,           "phone": phone_hashed,           "email": email_hashed         },    event_name: "Lead",   event_time: Date.now() / 1000 | 0, // UNIX timestamp in seconds, see: https://stackoverflow.com/a/221297/6178132   custom_data: {     workable_stage: inputData.workable_stage,   }  }]body = {  access_token: inputData.access_token,  upload_tag: "store_data",  data: fb_data}console.log(querystring.stringify(body));var postData = querystring.stringify(body);
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 407 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號