Skip to content

Instantly share code, notes, and snippets.

@Sephi-Chan
Created May 2, 2011 20:33
Show Gist options
  • Save Sephi-Chan/952298 to your computer and use it in GitHub Desktop.
Save Sephi-Chan/952298 to your computer and use it in GitHub Desktop.
HTTP request with Node
var body = JSON.stringify({
uuid: item.uuid
}),
options = {
host: settings.callback.hostname,
port: settings.callback.port,
path: settings.callback.path,
method: 'POST',
headers: {
'X-PQS-Secret-Key': settings.callback.secretKey,
'Content-Type': 'application/json',
'Content-Length': body.length
}
},
request = http.request(options, function(){});
request.on('error', function(){});
request.write(body);
request.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment