lib/client.js
function(url, callback) {
        if (isBrowser) {
            // Browser environments can't pipe, so download the file and add it
            return this.getImageDataFromUrl(url, function(err, data) {
                if (err) {
                    return callback(err);
                }

                this.addImageFromBuffer(data, callback);
            }.bind(this));
        }

        // Pipe the source URL into a POST-request
        request({ uri: url }).pipe(request({
            method: 'POST',
            uri: this.getSignedResourceUrl('POST', this.getImagesUrl()),
            json: true,
            headers: {
                'Accept': 'application/json',
                'User-Agent': 'imboclient-js'
            },
            onComplete: function(err, res, body) {
                callback(err, body ? body.imageIdentifier : null, body, res);
            }
        }));

        return this;
    }
function(url, callback) {
        if (isBrowser) {
            // Browser environments can't pipe, so download the file and add it
            return this.getImageDataFromUrl(url, function(err, data) {
                if (err) {
                    return callback(err);
                }

                this.addImageFromBuffer(data, callback);
            }.bind(this));
        }

        // Pipe the source URL into a POST-request
        request({ uri: url }).pipe(request({
            method: 'POST',
            uri: this.getSignedResourceUrl('POST', this.getImagesUrl()),
            json: true,
            headers: {
                'Accept': 'application/json',
                'User-Agent': 'imboclient-js'
            },
            onComplete: function(err, res, body) {
                callback(err, body ? body.imageIdentifier : null, body, res);
            }
        }));

        return this;
    }
function ( url , callback ) { if ( isBrowser ) { // Browser environments can't pipe, so download the file and add it return this . getImageDataFromUrl ( url , function ( err , data ) { if ( err ) { return callback ( err ) ; } this . addImageFromBuffer ( data , callback ) ; } . bind ( this ) ) ; } // Pipe the source URL into a POST-request request ( { uri : url } ) . pipe ( request ( { method : 'POST' , uri : this . getSignedResourceUrl ( 'POST' , this . getImagesUrl ( ) ) , json : true , headers : { 'Accept' : 'application/json' , 'User-Agent' : 'imboclient-js' } , onComplete : function ( err , res , body ) { callback ( err , body ? body . imageIdentifier : null , body , res ) ; } } ) ) ; return this ; }
Add an image from a remote URL

@param {String}   url
@param {Function} callback
@return {ImboClient}
Add an image from a remote URL