搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案