requestString method

void requestString({
  1. required Retrofit retrofit,
  2. Map<String, String>? headers,
  3. Map<String, dynamic>? params,
  4. OnResponseStringSuccessCall? successCall,
  5. OnResponseStringErrorCall? errorCall,
  6. OnResponseCompleteCall? completeCall,
  7. 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,
  );
}