node.js - Using nodejs http to send progress indications -
i'm trying send progress indications (to client) of http call i'm making third party api i'm getting error:
object
#<incomingmessage>
has no method 'write'
it references response.write(chunk.length)
http.get('/other/api', function(response) { var body = ''; response.on('data', function(chunk) { body += chunk; response.write(chunk.length); }); response.on('end', function() { return fn(json.parse(body)); }); });
note: snippet of code - fn
argument passed function snippet used in.
i'm not quite sure i'm implementing properly. please advise.
Comments
Post a Comment