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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -