src/googledrive.js
function (method, url, options) {
    if (! options.headers) { options.headers = {}; }
    options.headers['Authorization'] = 'Bearer ' + this.token;

    this.rs._emit('wire-busy', {
      method: method,
      isFolder: isFolder(url)
    });

    return WireClient.request.call(this, method, url, options).then((xhr) => {
      // Google tokens expire from time to time...
      if (xhr && xhr.status === 401) {
        this.connect();
        return;
      } else {
        if (!this.online) {
          this.online = true;
          this.rs._emit('network-online');
        }
        this.rs._emit('wire-done', {
          method: method,
          isFolder: isFolder(url),
          success: true
        });

        return Promise.resolve(xhr);
      }
    }, (error) => {
      if (this.online) {
        this.online = false;
        this.rs._emit('network-offline');
      }
      this.rs._emit('wire-done', {
        method: method,
        isFolder: isFolder(url),
        success: false
      });

      return Promise.reject(error);
    });
  }
function (method, url, options) {
    if (! options.headers) { options.headers = {}; }
    options.headers['Authorization'] = 'Bearer ' + this.token;

    this.rs._emit('wire-busy', {
      method: method,
      isFolder: isFolder(url)
    });

    return WireClient.request.call(this, method, url, options).then((xhr) => {
      // Google tokens expire from time to time...
      if (xhr && xhr.status === 401) {
        this.connect();
        return;
      } else {
        if (!this.online) {
          this.online = true;
          this.rs._emit('network-online');
        }
        this.rs._emit('wire-done', {
          method: method,
          isFolder: isFolder(url),
          success: true
        });

        return Promise.resolve(xhr);
      }
    }, (error) => {
      if (this.online) {
        this.online = false;
        this.rs._emit('network-offline');
      }
      this.rs._emit('wire-done', {
        method: method,
        isFolder: isFolder(url),
        success: false
      });

      return Promise.reject(error);
    });
  }
Make a network request.

@param {string} method - Request method
@param {string} url - Target URL
@param {Object} options - Request options
@returns {Promise} Resolves with the response of the network request

@private