score:0

Accepted answer

i haven't used it but it looks like you should do it like this.

var request = require('superagent-promise-headers')({
    headers: {
        post: { 
          "x-mashape-key": "xxxxxxxxxxxxx",
          "content-type": "application/x-www-form-urlencoded",
          "accept": "application/json" }
    }
});    
    // should i use  'superagent-promise-headers' instead?  im confused here
    
    var imagestore = reflux.createstore({
    
    ..
    .
    .
      
         decryptimage(file) {
            var reader = new filereader();
            var info = {}
        
            reader.onload = (output) => {
              request.post("https://camfind.p.mashape.com/image_requests")
               .send("image_request[locale]=en_us")
               .send("image_request[longitude]=14.3583203002251")
               .send("image_request[image]=reader")
               .then(function (result) {
                   console.log(result.status, result.headers, result.body);
this.info = result
                    },
                      function(error) {
                        console.log(error);
                    }
                    );
                }
            
                reader.readasdataurl(file);
                return info
              },
            
              onaddimage(file) {
                var info = this.decryptimage(file);
              },
        });


Related Query

More Query from same tag