Created
March 22, 2012 19:11
-
-
Save caseycesari/2161913 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https.get({ | |
host: 'api.cloudmine.me', | |
headers: {'X-CloudMine-ApiKey': CM_KEY}, | |
path: '/v1/app/' + CM_APP + '/text?keys=' + req.params.email | |
}, function(cmres) { | |
res.attachment('test.csv'); | |
cmres.on('data', function(chunk) { | |
data += chunk; | |
// do some stuff to data | |
}).on('end', function() { | |
res.end(data,'utf8'); | |
}); | |
}).on('error', function(e) { | |
res.writeHead(500, {'Content-Type': 'application/json'}); | |
res.end('{"error":"'+e+'"}'); | |
}); |
gsf
commented
Mar 22, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment