create<E> method

DynCallHttpExecutor<E> create<E>(
  1. HttpMethod method, {
  2. String? path,
  3. String? fullPath,
  4. Map<String, String>? parametersMap,
  5. Map<String, String>? parametersStatic,
  6. Map<String, ParameterProvider>? parametersProviders,
  7. String? queryString,
  8. dynamic noQueryString = false,
  9. Credential? authorization,
  10. List<String>? authorizationFields,
  11. Object? body,
  12. Object? bodyBuilder,
  13. String? bodyType,
  14. E? errorResponse,
  15. int errorMaxRetries = 3,
  16. HTTPOutputValidator? outputValidator,
  17. HTTPOutputFilter? outputFilter,
  18. HTTPJSONOutputFilter? jsonOutputFilter,
  19. String? outputFilterPattern,
  20. HTTPOutputInterceptor? outputInterceptor,
})

Implementation

DynCallHttpExecutor<E> create<E>(HttpMethod method,
    {String? path,
    String? fullPath,
    Map<String, String>? parametersMap,
    Map<String, String>? parametersStatic,
    Map<String, ParameterProvider>? parametersProviders,
    String? queryString,
    noQueryString = false,
    Credential? authorization,
    List<String>? authorizationFields,
    Object? body,
    Object? bodyBuilder,
    String? bodyType,
    E? errorResponse,
    int errorMaxRetries = 3,
    HTTPOutputValidator? outputValidator,
    HTTPOutputFilter? outputFilter,
    HTTPJSONOutputFilter? jsonOutputFilter,
    String? outputFilterPattern,
    HTTPOutputInterceptor? outputInterceptor}) {
  path = _notEmpty(path);
  fullPath = _notEmpty(fullPath);

  var callPath;
  var callFullPath;

  if (fullPath != null) {
    fullPath = _normalizePath(fullPath);
    callPath = fullPath;
    callFullPath = true;
  } else {
    path = _normalizePath(path);
    callPath =
        _basePath != null && _basePath!.isNotEmpty ? '$_basePath$path' : path;
    callFullPath = false;
  }

  // ignore: omit_local_variable_types
  DynCallHttpExecutor<E> executor = DynCallHttpExecutor(
      httpClient, method, callPath,
      fullPath: callFullPath,
      parametersMap: parametersMap,
      parametersStatic: parametersStatic,
      parametersProviders: parametersProviders,
      queryString: queryString,
      noQueryString: noQueryString,
      authorization: authorization,
      authorizationFields: authorizationFields,
      body: body,
      bodyBuilder: bodyBuilder,
      bodyType: bodyType,
      errorResponse: errorResponse,
      errorMaxRetries: errorMaxRetries,
      outputValidator: outputValidator,
      outputFilter: outputFilter,
      jsonOutputFilter: jsonOutputFilter,
      outputFilterPattern: outputFilterPattern,
      outputInterceptor: outputInterceptor);
  return executor;
}