Request options

Generated reference for ovok_sdk: request options.

  • Stable unknown
  • Release candidate not available
  • Development since 0.2.0-dev.51+80996d9

CancelToken

class CancelToken

Ends the requests that carry it; the Dart counterpart of an AbortSignal.

Constructors

CancelToken.new

CancelToken()

Properties

CancelToken.isCancelled

bool get isCancelled

Whether cancel has been called.

CancelToken.whenCancelled

Future<Object?> get whenCancelled

Completes with the reason given to cancel.

Methods

CancelToken.cancel

void cancel([Object? reason])

Aborts every request carrying this token; later calls change nothing.

ParameterTypeKindDefault
reasonObject?optional positional

Returns void.

RequestOptions

class RequestOptions

Per-request limits, accepted by every network method that has them.

Constructors

RequestOptions.new

RequestOptions({Duration? timeout, CancelToken? cancelToken})

Limits one exchange to timeout and ends it when cancelToken is cancelled.

ParameterTypeKindDefault
timeoutDuration?named
cancelTokenCancelToken?named

Properties

RequestOptions.timeout

final Duration? timeout

Replaces the client's timeout for each exchange of the request.

RequestOptions.cancelToken

final CancelToken? cancelToken

Cancelling it throws OvokCancelledException, and the request is not retried.

Last updated on

On this page