RequestOptions class

The internal request option class that is the eventual result after BaseOptions and Options are composed.

Mixed in types

Constructors

RequestOptions({String path = '', dynamic data, ProgressCallback? onReceiveProgress, ProgressCallback? onSendProgress, CancelToken? cancelToken, String? method, Duration? sendTimeout, Duration? receiveTimeout, Duration? connectTimeout, Map<String, dynamic>? queryParameters, String? baseUrl, Map<String, dynamic>? extra, Map<String, dynamic>? headers, ResponseType? responseType, String? contentType, ValidateStatus? validateStatus, bool? receiveDataWhenStatusError, bool? followRedirects, int? maxRedirects, bool? persistentConnection, RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ListFormat? listFormat, bool? setRequestContentTypeWhenNoPayload, StackTrace? sourceStackTrace})

Properties

baseUrl String
Request base url, it can contain sub paths like: https://pub.dev/api/.
read / writeinherited
cancelToken CancelToken?
Controls cancellation of Dio's requests.
read / write
connectTimeout Duration?
Timeout when opening url.
read / writeinherited
contentType String?
read / writeinherited
data ↔ dynamic
Request data in dynamic types.
read / write
extra Map<String, dynamic>
read / writeinherited
followRedirects bool
read / writeinherited
hashCode int
The hash code for this object.
read-onlyinherited
headers Map<String, dynamic>
read / writeinherited
listFormat ListFormat
read / writeinherited
maxRedirects int
read / writeinherited
method String
read / writeinherited
onReceiveProgress ProgressCallback?
The type of a progress listening callback when sending or receiving data.
read / write
onSendProgress ProgressCallback?
The type of a progress listening callback when sending or receiving data.
read / write
path String
Defines the path of the request. If it starts with "http(s)", baseUrl will be ignored. Otherwise, it will be combined and resolved with the baseUrl.
read / write
persistentConnection bool
read / writeinherited
queryParameters Map<String, dynamic>
Common query parameters.
read / writeinherited
receiveDataWhenStatusError bool
read / writeinherited
receiveTimeout Duration?
read / writeinherited
requestEncoder RequestEncoder?
read / writeinherited
responseDecoder ResponseDecoder?
read / writeinherited
responseType ResponseType
read / writeinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
sendTimeout Duration?
read / writeinherited
sourceStackTrace StackTrace?
The source StackTrace which should always point to the invocation of DioMixin.request or if not provided, to the construction of the RequestOptions instance. In both instances the source context should still be available before it is lost due to asynchronous operations.
read / write
uri Uri
Generate the requesting Uri from the options.
read-only
validateStatus ValidateStatus
read / writeinherited

Methods

copyWith({String? method, Duration? sendTimeout, Duration? receiveTimeout, Duration? connectTimeout, dynamic data, String? path, Map<String, dynamic>? queryParameters, String? baseUrl, ProgressCallback? onReceiveProgress, ProgressCallback? onSendProgress, CancelToken? cancelToken, Map<String, dynamic>? extra, Map<String, dynamic>? headers, ResponseType? responseType, String? contentType, ValidateStatus? validateStatus, bool? receiveDataWhenStatusError, bool? followRedirects, int? maxRedirects, bool? persistentConnection, RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ListFormat? listFormat, bool? setRequestContentTypeWhenNoPayload}) RequestOptions
Create a RequestOptions from current instance with merged 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