StandardResponseParser class

标准响应解析器 处理标准结构:{code: int, message: String, data: dynamic}

使用示例:

HttpUtil.configure(
  HttpConfig(
    baseUrl: 'https://api.example.com',
    responseParser: StandardResponseParser(),
  ),
);
Implemented types

Constructors

StandardResponseParser()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse<T>(RawHttpResponse raw) ApiResponse<T>
解析响应 raw 原始 HTTP 响应(statusCode、data、path) 返回用户定义的 Response,必须处理所有可能的响应结构
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited