dio_curl_logger 1.2.0 copy "dio_curl_logger: ^1.2.0" to clipboard
dio_curl_logger: ^1.2.0 copied to clipboard

A Flutter package for logging Dio HTTP requests as curl commands and responses, enabling easier debugging and analysis of network interactions.

example/main.dart

import 'package:dio/dio.dart';
import 'package:dio_curl_logger/dio_curl_logger.dart';

void main() async {
  final dio = Dio();

  // Add the CurlLoggingInterceptor
  dio.interceptors.add(
    CurlLoggingInterceptor(
      showRequestLog: true,
      showResponseLog: true,
    ),
  );

  // Make a sample HTTP request
  try {
    final response = await dio.get('https://google.com');
  } on Exception {
    print("Error occured");
  }
}
1
likes
160
pub points
37%
popularity

Publisher

unverified uploader

A Flutter package for logging Dio HTTP requests as curl commands and responses, enabling easier debugging and analysis of network interactions.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dio, flutter

More

Packages that depend on dio_curl_logger