lib/client.js
function(source, callback) {
        var url = this.getSignedResourceUrl('POST', this.getImagesUrl()),
            isFile = isBrowser && source instanceof window.File,
            onComplete = callback.onComplete || callback,
            onProgress = callback.onProgress || null;

        request({
            method: 'POST',
            uri: url,
            body: source,
            headers: {
                'Accept': 'application/json',
                'User-Agent': 'imboclient-js',
                'Content-Length': isFile ? source.size : source.length
            },
            onComplete: function(err, res, body) {
                body = jsonparse(body);
                onComplete(err, body ? body.imageIdentifier : null, body, res);
            },
            onProgress: onProgress
        });

        return this;
    }
function(source, callback) {
        var url = this.getSignedResourceUrl('POST', this.getImagesUrl()),
            isFile = isBrowser && source instanceof window.File,
            onComplete = callback.onComplete || callback,
            onProgress = callback.onProgress || null;

        request({
            method: 'POST',
            uri: url,
            body: source,
            headers: {
                'Accept': 'application/json',
                'User-Agent': 'imboclient-js',
                'Content-Length': isFile ? source.size : source.length
            },
            onComplete: function(err, res, body) {
                body = jsonparse(body);
                onComplete(err, body ? body.imageIdentifier : null, body, res);
            },
            onProgress: onProgress
        });

        return this;
    }
function ( source , callback ) { var url = this . getSignedResourceUrl ( 'POST' , this . getImagesUrl ( ) ) , isFile = isBrowser && source instanceof window . File , onComplete = callback . onComplete || callback , onProgress = callback . onProgress || null ; request ( { method : 'POST' , uri : url , body : source , headers : { 'Accept' : 'application/json' , 'User-Agent' : 'imboclient-js' , 'Content-Length' : isFile ? source . size : source . length } , onComplete : function ( err , res , body ) { body = jsonparse ( body ) ; onComplete ( err , body ? body . imageIdentifier : null , body , res ) ; } , onProgress : onProgress } ) ; return this ; }
Add an image from a Buffer, String or File instance

@param {Buffer|ArrayBuffer|String|File} source
@param {Function} callback
@return {ImboClient}
Add an image from a Buffer String or File instance