send(url, method, body = undefined, {
    timeoutMillis = this.defaultTimeoutMillis_,
    numAttempts = this.defaultNumAttempts_,
    headers = null,
    responseType = '',
  } = {}) {
    const entry = {
      resolver: new PromiseResolver(),
      url: url,
      method: method,
      headers: headers,
      responseType: responseType,
      body: body,
      timeoutMillis: timeoutMillis,
      numAttemptsLeft: numAttempts
    };

    if (this.numPendingRequests_ < this.maxRequests_) {
      this.startRequest_(entry);
    } else {
      this.queuedRequests_.push(entry);
    }

    return entry.resolver.promise;
  }
/**
   * Adds a request with the given parameters.
   * @param {string} url
   * @param {string} method
   * @param {string=} body
   * @param {{timeoutMillis: (number|undefined),
   *         numAttempts: (number|undefined),
   *         headers: (!Array<!Array<string>>|undefined),
   *         responseType: (string|undefined)}=} overrides "headers" is an Array
   *     of pairs of strings. "responseType" is a valid
   *     XMLHttpRequest.responseType enum value.
   * @return {!Promise<!XMLHttpRequest>} Resolves with the response. Rejects if
   *     the request timed out on all attempts.
   */
Adds a request with the given parameters.
Adds a request with the given parameters .
send(url, method, body = undefined, {
    timeoutMillis = this.defaultTimeoutMillis_,
    numAttempts = this.defaultNumAttempts_,
    headers = null,
    responseType = '',
  } = {}) {
    const entry = {
      resolver: new PromiseResolver(),
      url: url,
      method: method,
      headers: headers,
      responseType: responseType,
      body: body,
      timeoutMillis: timeoutMillis,
      numAttemptsLeft: numAttempts
    };
    if (this.numPendingRequests_ < this.maxRequests_) {
      this.startRequest_(entry);
    } else {
      this.queuedRequests_.push(entry);
    }
    return entry.resolver.promise;
  }
send ( url , method , body = undefined , { timeoutMillis = this . defaultTimeoutMillis_ , numAttempts = this . defaultNumAttempts_ , headers = null , responseType = '' , } = { } ) { const entry = { resolver : new PromiseResolver ( ) , url : url , method : method , headers : headers , responseType : responseType , body : body , timeoutMillis : timeoutMillis , numAttemptsLeft : numAttempts } ; if ( this . numPendingRequests_ < this . maxRequests_ ) { this . startRequest_ ( entry ) ; } else { this . queuedRequests_ . push ( entry ) ; } return entry . resolver . promise ; }
Adds a request with the given parameters.
Adds a request with the given parameters .