devpul_dio 1.1.0
devpul_dio: ^1.1.0 copied to clipboard
Dio interceptor for DevPul. Shows Dio requests, responses and errors live in the DevPul browser UI, with curl commands.
devpul_dio #
Dio interceptor for DevPul. Shows each request, response and error live in the browser, with headers, bodies, timings and a curl command.
Install #
dependencies:
devpul: ^1.1.0
devpul_dio: ^1.1.0
Usage #
import 'package:devpul_dio/devpul_dio.dart';
import 'package:dio/dio.dart';
final dio = Dio()..interceptors.add(DevpulDioInterceptor());
Add it last so it sees headers set by other interceptors. Ignore rules, redaction, size limits and console output come from Devpul.configure in devpul. See the Dio page.
Mock rules and breakpoints set in the UI answer, fail, delay or pause its calls, and the UI can replay them: see Mocks, breakpoints and replay. Pass the Dio, DevpulDioInterceptor(dio: dio), so replays go out through its adapter.
Limits #
Debug builds, and profile builds built with DEVPUL_PROFILE. Streamed request and response bodies show as <stream>.