var https = require('https');
var options = { host: 'open.t.qq.com', port: 443, path: '/api/t/re_add', method: 'POST' };
var post_data = 'oauth_consumer_key=801243043&access_token=273f8fbb38254ef6f5519a2b88aa1bba&openid=a87980a620fdd44b54aa84a029b18654&clientip=127.0.0.1&oauth_version=2.a&scope=all&format=json&reid=273009086234102&content=imax_checkfHQsnMQaq'
var req = http.request(options, function(res) { console.log('STATUS: ' + res.statusCode); res.on('data', function (chunk) { console.log('BODY: ' + chunk); }); });
req.on('error', function(e) { console.log('problem with request: ' + e.stack); res.end('error'); });
// write data to request body req.write(post_data); req.end();
代码如上所示, 定时并发调用这个去腾讯请求数据,一开始请求返回没有问题,但是过一段时间之后就,data事件就再也收不到消息了。有人遇到过没,也没有error事件。不知道是没法出去还是没响应。在linux下同一个环境curl发同样的请求却能够返回正确结果,重启下也能返回结果,但过一段时间又会出现同样的问题。 tencent开放平台的很多接口都有这个问题。 球大神破解。