Skip to content

Instantly share code, notes, and snippets.

Created December 23, 2010 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/752482 to your computer and use it in GitHub Desktop.
Save anonymous/752482 to your computer and use it in GitHub Desktop.
var data = querystring.stringify({'file_ext[gistfile1]': opt.ext, 'file_name[gistfile1]': opt.file, 'file_contents[gistfile1]': contents })
var request = client.request('POST', '/gists', {
'Host': 'gist.github.com',
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length
})
request.end(data)
request.on('response', function(res) {
res.on('end', function() {
console.log(res.headers.location)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment