options method

  1. @override
Future<Either<Failure, Response>> options({
  1. required String endpoint,
  2. Map<String, dynamic>? params,
  3. Duration? receiveTimeout,
  4. Duration? sendTimeout,
  5. Map<String, String>? headers,
  6. CancelToken? cancelToken,
  7. ResponseType? responseType,
  8. String? tag,
  9. bool showLoader = true,
  10. bool dedupe = true,
})
override

Sends an OPTIONS request to endpoint.

Asks the server which methods and CORS rules apply to a resource. Rarely needed from app code — browsers issue their own preflights — but useful for capability discovery against an API that advertises itself this way.

Idempotent, so transient failures are retried like a get.

Implementation

@override
Future<Either<Failure, Response>> options({
  required String endpoint,
  Map<String, dynamic>? params,
  Duration? receiveTimeout,
  Duration? sendTimeout,
  Map<String, String>? headers,
  CancelToken? cancelToken,
  ResponseType? responseType,
  String? tag,
  bool showLoader = true,
  bool dedupe = true,
}) {
  return _respond(
    HttpMethod.options,
    endpoint,
    params: params,
    headers: headers,
    tag: tag,
    cancelToken: cancelToken,
  );
}