Skip to content

Instantly share code, notes, and snippets.

@iriberri
Last active August 29, 2015 14:05
Show Gist options
  • Save iriberri/3b415cd270d824895421 to your computer and use it in GitHub Desktop.
Save iriberri/3b415cd270d824895421 to your computer and use it in GitHub Desktop.
CartoDB import API with NodeJS
with form-data npm package
var form = new FormData();form.append('file', fs.createReadStream(path.join(__dirname, '../automation/testCarto.csv')));//${PROTOCOL}://${CDB_USER}.cartodb.com/api/v1/imports/?api_key=${API_KEY}form.submit({ protocol: 'https:', host:'xxx.cartodb.com', path:'/api/v1/imports/?api_key=xxxxxxx', method: 'post'}, function(err, res) { console.log(res.statusCode); console.log(err); test.object(res); done();});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment