RequestOptions constructor

RequestOptions({
  1. String path = '',
  2. dynamic data,
  3. ProgressCallback? onReceiveProgress,
  4. ProgressCallback? onSendProgress,
  5. CancelToken? cancelToken,
  6. String? method,
  7. Duration? sendTimeout,
  8. Duration? receiveTimeout,
  9. Duration? connectTimeout,
  10. Map<String, dynamic>? queryParameters,
  11. String? baseUrl,
  12. Map<String, dynamic>? extra,
  13. Map<String, dynamic>? headers,
  14. bool? preserveHeaderCase,
  15. ResponseType? responseType,
  16. String? contentType,
  17. ValidateStatus? validateStatus,
  18. bool? receiveDataWhenStatusError,
  19. bool? followRedirects,
  20. int? maxRedirects,
  21. bool? persistentConnection,
  22. RequestEncoder? requestEncoder,
  23. ResponseDecoder? responseDecoder,
  24. ListFormat? listFormat,
  25. bool? setRequestContentTypeWhenNoPayload,
  26. 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;
}