Skip to content

Instantly share code, notes, and snippets.

@sifu
Created October 18, 2010 13:04
Show Gist options
  • Save sifu/632177 to your computer and use it in GitHub Desktop.
Save sifu/632177 to your computer and use it in GitHub Desktop.
consume whole http body
function HttpBodyServer( callback ) {
return http.createServer( function( request, response ) {
var body = '';
request.on( 'data', function( chunk ) {
body += chunk.toString( );
} );
request.on( 'end', function( ) {
callback( request, response, body );
} );
} );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment