RequestOptions class

Per-request options to override defaults.

Use this to customize individual requests without changing the client config.

Constructors

RequestOptions({Map<String, String>? headers, Duration? timeout, String? baseUrlOverride, bool includeToken = true, Map<String, String> extraHeaders = const {}})
const

Properties

baseUrlOverride String?
Override base URL for this request (e.g. for CDN or different API).
final
extraHeaders Map<String, String>
Extra headers merged with request headers.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
Additional or override headers for this request.
final
includeToken bool
Whether to include auth token. Defaults to true.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration?
Request timeout. Overrides default from config.
final

Methods

copyWith({Map<String, String>? headers, Duration? timeout, String? baseUrlOverride, bool? includeToken, Map<String, String>? extraHeaders}) RequestOptions
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