Skip to main content

basic_http_interceptor 0.2.1 copy "basic_http_interceptor: ^0.2.1" to clipboard
basic_http_interceptor: ^0.2.1 copied to clipboard

Pluggable HTTP interceptors for logging, headers, timeouts, hooks, and proxies, plus dynamic routing, RFC 7234 URL file caching, and LRU disk quota utilities.

0.2.1 #

Fixed #

  • Raised minimum http dependency constraint to ^1.5.0 so Abortable, AbortableRequest, and AbortableMultipartRequest pass pub.dev downgrade analysis.

0.2.0 #

Added #

  • UrlFileCache & loadUriText: Decoupled, RFC 7234-compliant URL-to-file cache with HTTP 304 validation, single-flight request deduplication, atomic writes, TTL/sync lookup (getCachedFile), and offline fallback.
  • DirectoryQuotaManager: Standalone LRU disk quota manager with sidecar pairing (companionResolver), configurable sort strategies (LruSortStrategy), and orphan .tmp cleanup.

Documentation #

  • Added a usage guide for UrlFileCache and DirectoryQuotaManager in README.md.

0.1.10 #

Added #

  • Sub-library Entrypoint package:basic_http_interceptor/testing.dart:
    • Re-exports package:http/testing.dart (exposing [MockClient] and [MockClientHandler]) for deterministic unit testing and mocking.
    • Allows downstream projects and unit test suites to mock HTTP calls directly without adding package:http to their own pubspec.yaml dev_dependencies.

0.1.9 #

Added #

  • Sub-library Entrypoint package:basic_http_interceptor/io_client.dart:
    • Re-exports package:http/io_client.dart (exposing [IOClient]) so native/VM applications can access IOClient directly without adding package:http to their pubspec.yaml.
    • Keeps platform-specific dart:io dependencies isolated, preserving 100% Web and WASM compatibility for the root library and http.dart.
    • Adds proxyIoClient: a convenient factory to build raw, non-intercepted IOClient instances with environment-based proxy configurations (http_proxy, https_proxy, all_proxy, no_proxy) and optional SSL certificate verification callbacks (badCertificateCallback).

0.1.8 #

Changed #

  • Isolated HTTP Dependencies: The root library basic_http_interceptor.dart no longer re-exports http_interceptor or http, eliminating global namespace pollution (preventing top-level get/post functions and Response/Request collisions).

Added #

  • Sub-library Entrypoints:
    • package:basic_http_interceptor/http.dart: Re-exports package:http (recommended for use with import ... as http;).
    • package:basic_http_interceptor/http_interceptor.dart: Re-exports package:http_interceptor for advanced contracts.

Migration #

// Before: naked import polluted scope with top-level get(), post(), Response, etc.
import 'package:basic_http_interceptor/basic_http_interceptor.dart';

// Now: import raw HTTP types with a prefix from the dedicated sub-library
import 'package:basic_http_interceptor/http.dart' as http;

0.1.7 #

Features #

  • Add proxyClient convenience factory: a versatile and extensible HTTP client builder where all parameters are optional and can be composed on demand (custom interceptors, default headers, timeout duration, proxy rules, and logger).
  • Add automatic authorization header normalization and token inference helpers:
    • normalizeAuthorizationHeaders: Normalizes authorization headers case-insensitively.
    • inferAuthorizationHeaderValue: Automatically infers JWT Bearer tokens or Base64 Basic credentials when schemes are omitted.
    • isJwt & isBase64Credentials: Format validation helper utilities.

Documentation & DX #

  • Update README.md with the Reusable Client Factory guide, highlighting optional parameter flexibility and modular configuration.
  • Comprehensive unit test coverage for proxyClient and token inference helpers.

0.1.6 #

Features #

  • Add InterceptorTimeout to enforce physical socket/connection abortion on timeout using Abortable, with optional Logger warnings and onTimeout callbacks.

Improvements & DX #

  • Re-export package:http_interceptor/http_interceptor.dart completely. All standard HTTP classes (Client, Request, Response, StreamedResponse, ClientException, RequestAbortedException, etc.) and extension methods (copyWith, addParameters, etc.) are now accessible directly from basic_http_interceptor.
  • Refresh English doc comments and include runnable usage examples for all interceptors and factory methods.
  • Update README.md with complete modular interceptor recipes and cross-platform examples.

Notes for Upgrading #

  • Fully Backward Compatible: No breaking changes.
  • Import Cleanup: You can now safely remove redundant import 'package:http/http.dart'; and import 'package:http_interceptor/http_interceptor.dart'; statements across your codebase.

0.1.5 #

  • Skip StreamedResponse body logging for compressed or known streamed content.
  • Keep body logging unchanged for normal Response objects.

0.1.4 #

  • Fix a streamed response logging stall when content-encoding is compressed (for example gzip).
  • Skip body text logging for compressed streamed responses and keep transparent pass-through.
  • Make X-Debug-Body header detection case-insensitive.

0.1.3 #

  • Refine InterceptorLogger response logging to avoid fully consuming StreamedResponse bodies.
  • Log streamed bodies in byte-based segments so SSE and long-lived streams stay responsive.
  • Simplify non-streamed response logging to a single write.
  • Improve MethodSwitchingClient routing docs for streaming, SSE, and upload scenarios.

0.1.2 #

  • Add MethodSwitchingClient for dynamic request routing between interceptor and default HTTP clients.
  • Document advanced usage with a concise subclass-based channel switching example.

0.1.1 #

  • InterceptorLogger, add optional logBodyMax parameter.
  • InterceptorLogger.interceptResponse, support StreamedResponse body logging.

0.1.0 #

  • InterceptorLogger,buffer logs to reduce file I/O operations.

0.0.6 #

  • InterceptorLogger,logBody = true, or exist header X-Debug-Body, output body.

0.0.5 #

  • supports all six platforms, with client separated for non-web platforms.

0.0.4 #

  • document update

0.0.3 #

  • remove basic_http_interceptor_test.dart
  • document update

0.0.2 #

  • remove dependencies basic_logger.
  • document update

0.0.1 #

  • Initial version.
0
likes
150
points
1.18k
downloads

Documentation

API reference

Publisher

verified publisheriche2.com

Weekly Downloads

Pluggable HTTP interceptors for logging, headers, timeouts, hooks, and proxies, plus dynamic routing, RFC 7234 URL file caching, and LRU disk quota utilities.

Repository (GitHub)
View/report issues

Topics

#http #network #interceptor #cache #proxy

Funding

Consider supporting this project:

github.com
buymeacoffee.com

License

MIT (license)

Dependencies

http, http_interceptor, logging

More

Packages that depend on basic_http_interceptor