Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log(files)
- async.eachOfSeries(files, function(file, callback){
- var idname = file.slice(0, -4);
- var options = {
- uri: 'http://(*api url*)',
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- 'apikey': '*apikey*',
- 'userid': '400',
- },
- json: [{
- "gender": "female",
- "uid": idname,
- "images":[{
- "imageUrl": "*imageurl*"+file,
- }]
- }]
- }
- request(options, function (error, response, body) {
- if(error) callback(error);
- if (!error && response.statusCode == 200) {
- console.log(body.id);
- }
- callback(null, "ok")
- });
- }, function(error){
- if(error) console.log(error)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement