I have a line of cURL:
curl -X POST --form "file=@Calvin Harris - Thinking About You (Tez Cadey Remix)_165299184_soundcloud.mp3" https://api.idolondemand.com/1/api/async/recognizespeech/v1
I'm building a hybrid mobile app with Meteor/Ionic as the framework. Therefore, I have access to any Node library that leverages cURL.
Can anyone:
1) Suggest one of the many node-curl libraries 2) Show me how to properly output the above cURL line in the context of the right library?
My primary issue that is stopping me is the
- ANSWER -
--form
flag. I've poured over several libraries/docs and none explicitly reference how to use this form flag. I cannot drop this flag, it's a requirement of the API.- ANSWER -
var fs = require('fs');
var https = require('https');
var rs = fs.createReadStream(
'Calvin Harris - Thinking About You (Tez Cadey Remix)_165299184_soundcloud.mp3'
);
var req = http.request({
hostname: 'api.idolondemand.com',
path: '/1/api/async/recognizespeech/v1',
method: 'POST'
}, function(res) {
// do something when you get a response
});
rs.pipe(req);
0 comments:
Post a Comment