any method
Future<Response>
any(
- String url,
- NetworkTypeDio type, {
- Map<
String, dynamic> ? body, - Map<
String, String> ? headers, - NetworkRequestFile? requestFile,
- ProgressCallbackFastor? onSendProgress,
- ProgressCallbackFastor? onReceiveProgress,
- bool? isEnableLogDioPretty,
- int? timeOutSecond,
- bool? handleErrorXMLHttpRequest,
- NetworkDiocallback_dio? callback,
Implementation
Future<Response> any(String url,
NetworkTypeDio type,
{Map<String, dynamic>? body,
Map<String, String>? headers,
/// file
NetworkRequestFile? requestFile,
ProgressCallbackFastor? onSendProgress,
ProgressCallbackFastor? onReceiveProgress,
bool? isEnableLogDioPretty ,
int? timeOutSecond,
bool? handleErrorXMLHttpRequest,
NetworkDiocallback_dio? callback}) async {
//set values
this.url = url;
this.type = type;
this.requestFile = requestFile;
this.callback_dio = callback;
this.timeOutSecond = timeOutSecond;
//handleErrorXMLHttpRequest
handleErrorXMLHttpRequest ??= false;
this.handleErrorXMLHttpRequest = handleErrorXMLHttpRequest;
//log
isEnableLogDioPretty ??= true;
this.isEnableLogDioPretty = isEnableLogDioPretty;
//set body and header
if (body != null) this.body = body;
if (headers != null) this.headers = headers;
//set values
this.url = url;
this.type = type;
//set body and header
if (body != null) this.body = body;
if (headers != null) this.headers = headers;
//edit headers
this.headers = setDefaultHeader(headers);
_setupNetworkTypeDefault();
_configureSetup();
//choose type
return await _chooseTypeNetworkThenStartService( onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress );
}