http_client_inspector 0.0.3 copy "http_client_inspector: ^0.0.3" to clipboard
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 #

Pub Version License: MIT


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 http package
  • In-app inspector panel: View detailed request, response, error, and header info directly inside your app
  • Easy integration: Simply wrap your http.Client instance 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 #

  1. Add dependency:
    Add http_client_inspector and http to your pubspec.yaml:

    dependencies:
      flutter:
        sdk: flutter
      http: any
      http_client_inspector: any
    
  2. 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.

0
likes
160
points
244
downloads

Publisher

unverified uploader

Weekly Downloads

A package to inspect http client package requests and responses in Flutter directly in your App.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, freezed_annotation, http, intl

More

Packages that depend on http_client_inspector