ApiOptions class
Constructors
-
ApiOptions({String? method, Duration? sendTimeout, Duration? receiveTimeout, Map<
String, dynamic> ? extra, Map<String, dynamic> ? headers, bool? preserveHeaderCase, ResponseType? responseType, String? contentType, ValidateStatus? validateStatus, bool? receiveDataWhenStatusError, bool? followRedirects, int? maxRedirects, bool? persistentConnection, RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ListFormat? listFormat})
Properties
- contentType ↔ String?
-
The request content-type.
getter/setter pairinherited
-
extra
↔ Map<
String, dynamic> ? -
An extra map that you can retrieve in
Interceptor
,Transformer
andResponse.requestOptions
.getter/setter pairinherited - followRedirects ↔ bool?
-
See HttpClientRequest.followRedirects.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
↔ Map<
String, dynamic> ? -
HTTP request headers.
getter/setter pairinherited
- listFormat ↔ ListFormat?
-
Indicates the format of collection data in request query parameters and
x-www-url-encoded
body data.getter/setter pairinherited - maxRedirects ↔ int?
-
The maximum number of redirects when
followRedirects
istrue
.RedirectException
will be thrown if redirects exceeded the limit.getter/setter pairinherited - method ↔ String?
-
The HTTP request method.
getter/setter pairinherited
- persistentConnection ↔ bool?
-
See HttpClientRequest.persistentConnection.
getter/setter pairinherited
- preserveHeaderCase ↔ bool?
-
Whether the case of header keys should be preserved.
getter/setter pairinherited
- receiveDataWhenStatusError ↔ bool?
-
Whether to retrieve the data if status code indicates a failed request.
getter/setter pairinherited
- receiveTimeout ↔ Duration?
-
Timeout when receiving data.
getter/setter pairinherited
- requestEncoder ↔ RequestEncoder?
-
The type of a request encoding callback.
getter/setter pairinherited
- responseDecoder ↔ ResponseDecoder?
-
The type of a response decoding callback.
getter/setter pairinherited
- responseType ↔ ResponseType?
-
The type of data that
Dio
handles with options.getter/setter pairinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendTimeout ↔ Duration?
-
Timeout when sending data.
getter/setter pairinherited
- validateStatus ↔ ValidateStatus?
-
Defines whether the request is considered to be successful
with the given status code.
The request will be treated as succeed if the callback returns true.
getter/setter pairinherited
Methods
-
compose(
BaseOptions baseOpt, String path, {Object? data, Map< String, dynamic> ? queryParameters, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, StackTrace? sourceStackTrace}) → RequestOptions -
Merge a
BaseOptions
with the currentOptions
and compose them into theRequestOptions
.inherited -
copyWith(
{String? method, Duration? sendTimeout, Duration? receiveTimeout, Map< String, Object?> ? extra, Map<String, Object?> ? headers, bool? preserveHeaderCase, ResponseType? responseType, String? contentType, ValidateStatus? validateStatus, bool? receiveDataWhenStatusError, bool? followRedirects, int? maxRedirects, bool? persistentConnection, RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ListFormat? listFormat}) → ApiOptions - Create a Option from current instance with merging attributes.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited