RequestOptions constructor
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, - bool? preserveHeaderCase,
- ResponseType? responseType,
- String? contentType,
- ValidateStatus? validateStatus,
- bool? receiveDataWhenStatusError,
- bool? followRedirects,
- int? maxRedirects,
- bool? persistentConnection,
- RequestEncoder? requestEncoder,
- ResponseDecoder? responseDecoder,
- ListFormat? listFormat,
- bool? setRequestContentTypeWhenNoPayload,
- StackTrace? sourceStackTrace,
Implementation
RequestOptions({
this.path = '',
this.data,
this.onReceiveProgress,
this.onSendProgress,
this.cancelToken,
super.method,
super.sendTimeout,
super.receiveTimeout,
Duration? connectTimeout,
Map<String, dynamic>? queryParameters,
String? baseUrl,
super.extra,
super.headers,
super.preserveHeaderCase,
super.responseType,
super.contentType,
super.validateStatus,
super.receiveDataWhenStatusError,
super.followRedirects,
super.maxRedirects,
super.persistentConnection,
super.requestEncoder,
super.responseDecoder,
super.listFormat,
bool? setRequestContentTypeWhenNoPayload,
StackTrace? sourceStackTrace,
}) : assert(connectTimeout == null || !connectTimeout.isNegative) {
this.sourceStackTrace = sourceStackTrace ?? StackTrace.current;
this.queryParameters = queryParameters ?? {};
this.baseUrl = baseUrl ?? '';
this.connectTimeout = connectTimeout;
}