On Mon, Jul 29, 2013 at 12:48 AM, Leila Hamon <[email protected]> wrote:

> Any idea why I'm not getting the entire page back in the chunk of data?
>
> https://gist.github.com/anonymous/5eceaa5f2bbac855ecb1
>

The response object passed to the callback by http.get is a stream -- it
will emit data events as chunks of the response are read off the wire, so
'global.google' will end up being set to the most recent chunk of the page
that Node has seen. Either res.pipe() the response to wherever you want to
go, accumulate the response in a buffer (global.google +=
chunk.toString()), or use a simple wrapper like concat-stream (
https://github.com/maxogden/node-concat-stream).

F

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to