HttpClient to HTTPS API

35 views
Skip to first unread message

Marcos Chicote

unread,
Nov 26, 2014, 4:17:26 PM11/26/14
to res...@googlegroups.com
Hi
I'm trying to request some information from an HTTPS API. The following works fine:


However, this hangs: 

var client = restify.createClient({
url: "https://api.mercadolibre.com"
});

search = function(response, name, store_id, limit, offset) {
client.get("/sites/MLA/search?q=cartera&seller_id=156853713&limit=10&offset=0", function (err, req) {
assert.ifError(err); // connection error
var str = ''

req.on('result', function (err, v_res) {
assert.ifError(err); // HTTP status code >= 400

v_res.on('data', function (chunk) {
str += chunk;
});

v_res.on('end', function () {
response.send(str)
});
});
});
}

with the following error: ECONNRESET.
Googling around I found this post: http://stackoverflow.com/questions/10771875/node-js-https-request-error but the answer does not seem to work for me.

Any ideas?
Thanks

Reply all
Reply to author
Forward
0 new messages