http_client_inspector 0.0.3
http_client_inspector: ^0.0.3 copied to clipboard
A package to inspect http client package requests and responses in Flutter directly in your App.
http_client_inspector #
http_client_inspector is a Flutter package that provides easy logging and inspection of network activity for applications using the http package. It helps developers debug and monitor HTTP requests/responses directly from their apps, providing an in-app inspector panel for real-time network analysis.
Features #
- Automatic logging of all data passed through HTTP requests using the
httppackage - In-app inspector panel: View detailed request, response, error, and header info directly inside your app
- Easy integration: Simply wrap your
http.Clientinstance with an inspector - Supports all standard HTTP methods
- No special setup required: Works with your existing codebase
- Active only in debug by default: Won't affect production builds
Getting started #
-
Add dependency:
Addhttp_client_inspectorandhttpto yourpubspec.yaml:dependencies: flutter: sdk: flutter http: any http_client_inspector: any -
Basic usage:
You only need to initialize the inspector once in your main function:import 'package:http_client_inspector/http_client_inspector.dart'; void main() { InspectorManager.init(config: InspectorConfig()); runApp(const MyApp()); }Then, wrap your HTTP client with
ClientInspector:import 'package:http/http.dart'; final client = ClientInspector(innerClient: Client());You can open the inspector panel in your app via a button that pushes
InspectorHttpPanelView().Navigator.push( context, MaterialPageRoute<void>( builder: (context) => const InspectorHttpPanelView(), ), ),
Usage Example #
Here is a sample use case from example/lib/main.dart:
💡 Inspired By #
droido similar package but use dio instead of http client.
RoadMap #
- Add a way to exports logs (in different format)
Additional information #
- License: MIT License - see the LICENSE file for details.
- More info: GitHub repository
- Bug reports and feature requests: issue tracker
- Contribution: Contributions are welcome! Please submit pull requests or open an issue for suggestions.
Made with ❤️ for the Flutter community.