Skip to content

Instantly share code, notes, and snippets.

@jed
Created July 1, 2010 08:30
Show Gist options
  • Save jed/459723 to your computer and use it in GitHub Desktop.
Save jed/459723 to your computer and use it in GitHub Desktop.
var http = require( "http" )
, puts = require( "sys" ).puts
, str = "?token=xxx&apiKey=xxx"
, request = http
.createClient( 80, "rpxnow.com", true )
.request( "POST", "/api/v2/auth_info", {
host: "rpxnow.com",
"content-length": str.length
});
request
.addListener( "response", function( response ) {
response
.addListener( "data", function( chunk ) {
puts( chunk.toString() )
})
});
request.write( str );
request.end();
http:909
parser.finish();
^
TypeError: Cannot call method 'finish' of undefined
at Client.onend (http:909:12)
at IOWatcher.callback (net:493:28)
at node.js:221:9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment