io.js
function(xhr, promise, headers, method) {
            // XDR cannot set requestheaders, only XHR:
            if (!xhr._isXDR) {
                console.log(NAME, '_setHeaders');
                var name;
                if ((method!=='POST') && (method!=='PUT')) {
                    // force GET-request to make a request instead of using cache (like IE does):
                    headers['If-Modified-Since'] = 'Wed, 15 Nov 1995 01:00:00 GMT';
                    // header 'Content-Type' should only be set with POST or PUT requests:
                    delete headers[CONTENT_TYPE];
                }
                // set all headers
                for (name in headers) {
                    xhr.setRequestHeader(name, headers[name]);
                }

                // in case of POST or PUT method: always make sure 'Content-Type' is specified
                ((method!=='POST') && (method!=='PUT')) || (headers && (CONTENT_TYPE in headers)) || xhr.setRequestHeader(CONTENT_TYPE, DEF_CONTENT_TYPE_POST);
            }
        }
function(xhr, promise, headers, method) {
            // XDR cannot set requestheaders, only XHR:
            if (!xhr._isXDR) {
                console.log(NAME, '_setHeaders');
                var name;
                if ((method!=='POST') && (method!=='PUT')) {
                    // force GET-request to make a request instead of using cache (like IE does):
                    headers['If-Modified-Since'] = 'Wed, 15 Nov 1995 01:00:00 GMT';
                    // header 'Content-Type' should only be set with POST or PUT requests:
                    delete headers[CONTENT_TYPE];
                }
                // set all headers
                for (name in headers) {
                    xhr.setRequestHeader(name, headers[name]);
                }

                // in case of POST or PUT method: always make sure 'Content-Type' is specified
                ((method!=='POST') && (method!=='PUT')) || (headers && (CONTENT_TYPE in headers)) || xhr.setRequestHeader(CONTENT_TYPE, DEF_CONTENT_TYPE_POST);
            }
        }
function ( xhr , promise , headers , method ) { // XDR cannot set requestheaders, only XHR: if ( ! xhr . _isXDR ) { console . log ( NAME , '_setHeaders' ) ; var name ; if ( ( method !== 'POST' ) && ( method !== 'PUT' ) ) { // force GET-request to make a request instead of using cache (like IE does): headers [ 'If-Modified-Since' ] = 'Wed, 15 Nov 1995 01:00:00 GMT' ; // header 'Content-Type' should only be set with POST or PUT requests: delete headers [ CONTENT_TYPE ] ; } // set all headers for ( name in headers ) { xhr . setRequestHeader ( name , headers [ name ] ) ; } // in case of POST or PUT method: always make sure 'Content-Type' is specified ( ( method !== 'POST' ) && ( method !== 'PUT' ) ) || ( headers && ( CONTENT_TYPE in headers ) ) || xhr . setRequestHeader ( CONTENT_TYPE , DEF_CONTENT_TYPE_POST ) ; } }
Adds the `headers`-object to `xhr`-headers.

@method _setHeaders
@param xhr {Object} containing the xhr-instance
@param headers {Object} containing all headers
@param method {String} the request-method used
@private
Adds the headers - object to xhr - headers .