call method

Future<HttpResponse?> call(
  1. Map<String, dynamic>? parameters, {
  2. Object? body,
  3. int? maxRetries,
})

Performs a call, making the HTTP request.

Implementation

Future<HttpResponse?> call(Map<String, dynamic>? parameters,
    {Object? body, int? maxRetries}) async {
  maxRetries ??= this.maxRetries;

  var limit = Math.max(1, 1 + maxRetries);

  HttpResponse? response;

  for (var i = 0; i < limit; i++) {
    response = await _doRequestImp(parameters, body);
    if (response.isOK) {
      return response;
    }
  }

  return response;
}