dio_debugger 0.1.5
dio_debugger: ^0.1.5 copied to clipboard
Lightweight utility to attach a reverse/forward proxy to an existing Dio instance for local debugging.
import 'package:dio/dio.dart';
import 'package:dio_debugger/dio_debugger.dart';
Future<void> main() async {
final dio = Dio(
BaseOptions(baseUrl: 'https://api.example.com'),
);
// Attach reverse proxy interceptor for local debugging
// Set resetCaptureOnHotRestart: true to automatically clear previous sessions
// and start a new capture on each hot restart
DioDebugger.attach(
dio,
resetCaptureOnHotRestart: true,
);
final response = await dio.get('/health');
print('Status: \'${response.statusCode}\'');
}