http_interceptor_plus 0.0.1 copy "http_interceptor_plus: ^0.0.1" to clipboard
http_interceptor_plus: ^0.0.1 copied to clipboard

Dart package for enhanced HTTP logging. Middleware for http package.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:http_interceptor_plus/http_interceptor_plus.dart';

void main() async {
  // Create an instance of LoggingMiddleware and add it to the http.Client
  final http.Client client = LoggingMiddleware(http.Client());

  try {
    // Make an HTTP GET request
    final response = await client
        .get(Uri.parse('https://jsonplaceholder.typicode.com/posts/1'));

    // Print the response status code
    debugPrint('GET Response: ${response.statusCode}');
  } catch (e) {
    // Print any error that occurs during the request
    debugPrint('GET Error: $e');
  }
}
11
likes
160
points
156
downloads

Publisher

verified publisheritpathsolutions.com

Weekly Downloads

Dart package for enhanced HTTP logging. Middleware for http package.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, http, logger, plugin_platform_interface

More

Packages that depend on http_interceptor_plus