getDioWrapper static method
InterceptorsWrapper
getDioWrapper()
Implementation
static InterceptorsWrapper getDioWrapper() {
return InterceptorsWrapper(
onRequest: (RequestOptions options, RequestInterceptorHandler handler) {
RapUtils rap = new RapUtils();
var proxy = rap.tryProxy(options.path, options.method);
if (proxy != false) {
return handler.resolve(Response(
data: proxy,
headers: new Headers(),
isRedirect: false,
requestOptions: options,
statusCode: 200,
statusMessage: 'OK'));
} else {
return handler.next(options);
}
});
}