ApiRequest class

一个客户端 API 请求。

Constructors

ApiRequest(String method, String path, {Map<String, Object?>? query, Object? body, bool auth = true, int? timeoutMs, DRCancelToken? cancel, bool noRenew = false, void onStatus(int status)?})

Properties

auth → bool
默认 true:带 Authorization。登录、注册、续期、退出为 false。
final
body → Object?
final
cancel → DRCancelToken?
final
hashCode → int
The hash code for this object.
no setterinherited
method → String
final
noRenew → bool
续期失败后不再续期(续期本身、带 refresh token 的退出)。
final
onStatus → void Function(int status)?
收到响应时告知 HTTP 状态码(区分 201 新建与 200 重复提交等)。
final
path → String
以 / 开头,如 /client/v1/me。
final
query → Map<String, Object?>?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timeoutMs → int?
final

Methods

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