requestString method
void
requestString({
- required Retrofit retrofit,
- Map<
String, String> ? headers, - Map<
String, dynamic> ? params, - OnResponseStringSuccessCall? successCall,
- OnResponseStringErrorCall? errorCall,
- OnResponseCompleteCall? completeCall,
- bool enableIntervalRefresh = true,
网络请求实例
retrofit
请求对象
params
请求参数
responseCall
响应回调
Implementation
void requestString({
required Retrofit retrofit,
Map<String, String>? headers,
Map<String, dynamic>? params,
OnResponseStringSuccessCall? successCall,
OnResponseStringErrorCall? errorCall,
OnResponseCompleteCall? completeCall,
bool enableIntervalRefresh = true,
}) async {
String requestId = Uuid().v4().toString();
if (completeCall != null) {
_requestActMap[requestId] = completeCall;
}
var responseInterceptor = _getResponseInterceptor();
_request(
retrofit: retrofit,
headers: headers,
params: params,
requestId: requestId,
responseCall: _InternalStringCall(requestId, successCall, errorCall, completeCall, responseInterceptor),
enableCache: true,
);
}