Search packages, repositories and app categories

Package detailsv1.0.1

curl_logger_dio_interceptor

Get your http requests printed as curl command in your terminal. Share them easily with your colleagues and import them in Postman!

AndroidiOSWebmacOSWindowsLinux
30-day downloads
39.3K
Likes
41
Pub points
150

Install package

flutter pub add curl_logger_dio_interceptor

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The curl_logger_dio_interceptor package enhances Dio, a popular HTTP client for Dart, by logging every HTTP request as a corresponding curl command in the terminal. This allows developers to easily view, share, and debug API calls with teammates or import them directly into tools like Postman. It integrates seamlessly with existing Dio configurations and supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux. Ideal for development and collaboration workflows where quick inspection of HTTP traffic is essential.

Use cases

  • Debugging API requests
  • Sharing requests with team members
  • Importing requests into Postman
  • Testing endpoints in terminal
  • Monitoring HTTP traffic during development

Key features

  • Logs HTTP requests as curl commands
  • Seamless integration with Dio
  • Supports multiple platforms
  • Easy sharing of requests
  • Real-time terminal output

Suitable for

  • Dart developers using Dio
  • Teams collaborating on API work
  • Frontend and backend developers
  • CI/CD pipeline debugging
  • Quick API testing

Considerations

  • Not intended for production use
  • May expose sensitive data if used carelessly
  • Requires manual activation in Dio
  • Limited to HTTP request logging only
  • No response logging included

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

curl_logger_dio_interceptor

pub package

A Flutter curl-command generator for Dio.

curl_logger_dio_interceptor log output

Easily test your Flutter-made requests in your favorite terminal or even in Postman or Insomnia.

Why?

Sometimes you want to replay the HTTP requests made in your app, or you want to share it with your beloved backend developer. Or you just love CURL.

Use your app as you want, and when the broken-request comes, look at your terminal, copy and paste it, and enjoy replaying it easily!

Features

  • Simple GET/POST/DELETE/PUT requests logging
  • With data when available
  • Postman-ready

Getting Started

_dio = Dio();

_dio.interceptors.add(CurlLoggerDioInterceptor());

Depending on your needs, you can also pass printOnSuccess: true to print all requests instead of only errored ones.

By default, convertFormData is true and converts FormData to plain Map so we can get a CURL representation even while using FormData (as for file uploads).

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package