伙计们,我在请求此 URL 时遇到问题。看起来不错,但我总是收到错误 ECONNRESET。
我用 ruby 写了一个小脚本,效果很好。在终端中使用 cURL 也可以。
我尝试了很多问题和堆栈溢出线程的所有解决方案......就像这些: https ://github.com/joyent/node/issues/5360 https://github.com/joyent/node/issues/5119
知道它可能是什么吗?
网址是:https ://ecommerce.cielo.com.br/servicos/ecommwsec.do
var https = require('https');
var options = {
host: 'ecommerce.cielo.com.br',
path: '/servicos/ecommwsec.do',
//This is what changes the request to a POST request
method: 'GET',
};
https.globalAgent.options.secureProtocol = 'SSLv3_method';
callback = function(response) {
var str = ''
response.on('data', function (chunk) {
str += chunk;
});
response.on('end', function () {
console.log(str);
});
}
var req = https.request(options, callback);
req.on('error', function(e) {
console.log('problem with request: ' + e.message);
});