onRequest method
Called when the request is about to be sent.
Implementation
@override
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
if (showLogRequest) {
String loggerText = "API-REQUEST";
loggerText += "\nAPI PATH: ${options.baseUrl}${options.path}";
loggerText += "\nMETHOD: ${options.method}";
loggerText += "\nHEADER: ${options.headers}";
if (options.data != null) {
loggerText += "\nDATA: ${options.data}";
}
logger.d(loggerText);
}
super.onRequest(options, handler);
}