basic_http_interceptor 0.1.7
basic_http_interceptor: ^0.1.7 copied to clipboard
HTTP Interceptors for Beginners, Logging, Headers, Proxies, and Hooks.
0.1.7 #
Features #
- Add
proxyClientconvenience 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.mdwith theReusable Client Factoryguide, highlighting optional parameter flexibility and modular configuration. - Comprehensive unit test coverage for
proxyClientand token inference helpers.
0.1.6 #
Features #
- Add
InterceptorTimeoutto enforce physical socket/connection abortion on timeout usingAbortable, with optionalLoggerwarnings andonTimeoutcallbacks.
Improvements & DX #
- Re-export
package:http_interceptor/http_interceptor.dartcompletely. All standard HTTP classes (Client,Request,Response,StreamedResponse,ClientException,RequestAbortedException, etc.) and extension methods (copyWith,addParameters, etc.) are now accessible directly frombasic_http_interceptor. - Refresh English doc comments and include runnable usage examples for all interceptors and factory methods.
- Update
README.mdwith 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';andimport 'package:http_interceptor/http_interceptor.dart';statements across your codebase.
0.1.5 #
- Skip
StreamedResponsebody logging for compressed or known streamed content. - Keep body logging unchanged for normal
Responseobjects.
0.1.4 #
- Fix a streamed response logging stall when
content-encodingis compressed (for examplegzip). - Skip body text logging for compressed streamed responses and keep transparent pass-through.
- Make
X-Debug-Bodyheader detection case-insensitive.
0.1.3 #
- Refine
InterceptorLoggerresponse logging to avoid fully consumingStreamedResponsebodies. - 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
MethodSwitchingClientrouting docs for streaming, SSE, and upload scenarios.
0.1.2 #
- Add
MethodSwitchingClientfor 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
logBodyMaxparameter. - InterceptorLogger.interceptResponse, support
StreamedResponsebody 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.