request method
void
request({
- required Retrofit retrofit,
- Map<
String, String> ? headers, - Map<
String, dynamic> ? params, - OnResponseSuccessCall? successCall,
- OnResponseErrorCall? errorCall,
- OnResponseCompleteCall? completeCall,
网络请求实例
retrofit
请求对象
params
请求参数
responseCall
响应回调
Implementation
void request({
required Retrofit retrofit,
Map<String, String>? headers,
Map<String, dynamic>? params,
OnResponseSuccessCall? successCall,
OnResponseErrorCall? errorCall,
OnResponseCompleteCall? completeCall,
}) async {
String requestId = Uuid().v4().toString();
if (completeCall != null) {
_requestActMap[requestId] = completeCall;
}
_requestForMap(
retrofit: retrofit,
headers: headers,
params: params,
requestId: requestId,
responseCall: _InternalResponseCall(requestId, successCall, errorCall, completeCall),
enableCache: true,
);
}