code: function request(options) {
      // Prepare options
      var opts = extend({}, options);
      opts.method = opts.method.toUpperCase();
      opts.uri = opts.uri.toString();
  
      // Instantiate request
      var xhr = new XMLHttpRequest();
  
      // Request finished handler
      xhr.onreadystatechange = function() {
          if (xhr.readyState === 4 && xhr.status !== 0 && opts.onComplete) {
              var err = null;
              if (xhr.status >= 400) {
                  err = new Error('HTTP ' + xhr.status + ' ' + xhr.statusText);
                  err.statusCode = xhr.status;
              }
  
              opts.onComplete(
                  err,
                  normalizeResponse(xhr),
                  opts.json ? JSON.parse(xhr.responseText) : xhr.responseText
              );
          }
      };
  
      // Request failure handler
      xhr.onerror = function() {
          opts.onComplete(new Error('XHR error - CORS denied?'), normalizeResponse(xhr));
      };
  
      // Request progress handler
      if (opts.onProgress) {
          xhr.upload.addEventListener('progress', opts.onProgress, false);
      }
  
      // Open the request
      xhr.open(opts.method, opts.uri, true);
  
      // Apply request headers
      for (var key in opts.headers) {
          // We're not allowed to set certain headers in browsers
          if (disallowedHeaders.indexOf(key) > -1) {
              continue;
          }
  
          xhr.setRequestHeader(key, opts.headers[key]);
      }
  
      // Is this a JSON-request?
      if (opts.json) {
          xhr.setRequestHeader('Accept', 'application/json');
  
          // Do we have a payload to deliver as JSON?
          if (typeof opts.json !== 'boolean') {
              xhr.setRequestHeader('Content-Type', 'application/json');
              opts.body = JSON.stringify(opts.json);
          }
      }
  
      // Send the request
      xhr.send(opts.body);
  }
docs: Send an HTTP request with the given options
  
  @param {Object} options