retry method

Future<Null> retry(
  1. RetriableRequest retriable
)

Implementation

Future<Null> retry(RetriableRequest retriable) async {
  RequestOptions requestOptions = retriable.error.requestOptions;
  final options = new Options(
    method: requestOptions.method,
    headers: requestOptions.headers,
  );

  Response response = await retriable.dio!.request(
    requestOptions.path,
    cancelToken: requestOptions.cancelToken,
    data: requestOptions.data,
    onReceiveProgress: requestOptions.onReceiveProgress,
    onSendProgress: requestOptions.onSendProgress,
    queryParameters: requestOptions.queryParameters,
    options: options,
  );

  retriable.handler.resolve(response);
}