options method
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,
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,
);
}