搜索插件、代码仓与 APP 分类

插件详情v1.0.1

curl_logger_dio_interceptor

在终端中将您的 HTTP 请求打印为 curl 命令。轻松与同事分享,并导入 Postman!

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
3.9万
喜欢数
41
Pub 分数
150

安装插件

flutter pub add curl_logger_dio_interceptor

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

curl_logger_dio_interceptor 包通过在终端中记录每个 HTTP 请求的对应 curl 命令来增强 Dio(Dart 的一个流行 HTTP 客户端)。这使得开发者可以轻松查看、分享和调试 API 调用,与团队成员协作或直接导入 Postman 等工具。它可无缝集成到现有的 Dio 配置中,并支持所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。非常适合需要快速检查 HTTP 流量的开发和协作工作流程。

适合场景

  • 调试 API 请求
  • 与团队成员共享请求
  • 将 requests 导入 Postman
  • 在终端中测试端点
  • 开发期间监控 HTTP 流量

主要特点

  • 将 HTTP 请求记录为 curl 命令
  • 与 Dio 的无缝集成
  • 支持多个平台
  • 轻松共享请求
  • 实时终端输出

适合对象

  • Dart 开发人员使用 Dio
  • 团队协作进行API工作
  • 前端和后端开发人员
  • CI/CD 流水线调试
  • 快速API测试

使用建议

  • 不适用于生产环境
  • 如果使用不当,可能会泄露敏感数据
  • 需要在Dio中手动激活
  • 仅限HTTP请求日志记录
  • 未包含响应日志

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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).

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目