   }
   
   public func sendRequestWithJSONResponse(requestParameters: RequestParameters,
-                                   queue: DispatchQueue = DispatchQueue.global(qos: .default)) -> Observable<(HTTPURLResponse, Any)> {
+                                          queue: DispatchQueue = DispatchQueue.global(qos: .default)) -> Observable<(HTTPURLResponse, Any)> {
     let responseSerializer = self.defaultJSONResponseSerializer()
     return self.sendRequest(requestParameters: requestParameters,
                             queue: queue,

      
      return Disposables.create()
    })
    .flatMap { [unowned self] uploadRequest -> Observable<(HTTPURLResponse, T.SerializedObject)> in
      return self.sendRequest(alamofireRequest: uploadRequest, queue: queue, responseSerializer: responseSerializer)
    }
  }
  

  
  fileprivate func sendAutoRetryRequest<T>(_ sendRequestBlock: @escaping () -> Observable<T>, renewTokenFunction: @escaping () -> Observable<Void>) -> Observable<T> {
    return sendRequestBlock()
      .catchError { [unowned self] (error: Error) -> Observable<T> in
        if self.shouldRenewToken(forError: error) {
          return renewTokenFunction()
            .do(onError: { [unowned self] error in
              // Ask for credentials if renew token fail for any reason
              self.askCredentials()
                .subscribe()
                .addDisposableTo(self.disposeBag)
            })
            .flatMap(sendRequestBlock)
        } else {
          throw error
        }
    }
  }
}
