p-hatan/ mirror

pub repository

mirror.p-hatan.com

curl_logger_dio_interceptor

1.0.1

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

Showing cached metadata. Upstream refresh is currently unavailable.

Cached in Iran · upstream_checksum

Download archive

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

Changelog

1.0.1

  • Fixed JSON escape for POST/PUT requests body data.

1.0.0

  • [BREAKING] Update dio to ^5.1.1
  • Fix example not building on latest android

0.0.3

  • Add convertFormData param (defaults: true) to convert FormData to plain Map so we can get a CURL representation even while using FormData (as for file uploads).

0.0.2

  • Use dart:developer.log() instead of print for cleaner logs (on android mostly)
  • Fix iOS example build.

0.0.1

  • Initial release including basic curl requests logging

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add curl_logger_dio_interceptor
pubspec.yaml
name: curl_logger_dio_interceptor
description: Get your http requests printed as curl command in your terminal. Share them easily with your colleagues and import them in Postman!
version: 1.0.1
homepage: https://github.com/OwnWeb/curl_logger_dio_interceptor

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  dio: ^5.1.1

dev_dependencies:
  flutter_lints: ^1.0.4

Version history

VersionPublishedArchiveSHA-256
0.0.12021-11-03T17:59:00.599807ZCached659de275f710928803cb658075d5dc819e9458a53666bc1d4114e32c0a9d8e5c
0.0.1+22021-11-03T18:01:32.812836ZCachedcab0f123f6fc0bdb07ad397b2a36083f0537da7eb82f27e422833e27415a2937
0.0.22021-11-04T09:48:05.908300ZCachede0a119311d61b59d180dcd3aaffe75fd130a188563c059c1df8e0773907f769c
0.0.32022-03-10T16:12:46.607078ZCached10f8137ced85d85a7e81843a822e6eba212157ae765abacd6bed028f334ef135
1.0.02023-04-13T06:55:46.879886ZCachedf20d89187a321d2150e1412bca30ebf4d89130bafc648ce21bd4f1ef4062b214
1.0.12025-11-13T06:07:08.498986ZCached0702d32b8ff1b451ba1d9882d57b885061872ebc38384c18243b18b2a0db2a5b

Dependencies

dio "^5.1.1"