sleek_http_client 1.2.0
sleek_http_client: ^1.2.0 copied to clipboard
A sleek, pure-Dart HTTP client with connectivity checking, token refresh, multipart support, and structured logging.
Changelog #
1.2.0 #
LoggingInterceptornow also logs exceptions thrown down the chain instead of a response (no internet, timeout, DNS / connection failure, ...) on a❌line, then rethrows them unchanged.- Fixed
send<void>()/send<Null>()/send<Object?>()throwingUnimplementedError(after the request was processed by the server) instead of resolving tonull. - Fixed the timeout not covering the request sending phase (only the body reading): a server that never sent its headers could block a request until the OS-level TCP timeout.
- Fixed a deadlock in
TokenRefreshInterceptorwhen the refresh callback sends its request through the same client after anawait(or behind an asynchronous interceptor): requests toexcludedPathsno longer wait for the in-flight refresh. - An empty success body is now treated like a JSON
nullforJsonObject/JsonList:send<JsonObject?>()resolves tonull,send<JsonObject>()throwsNullResponseBodyException(previously both threw aFormatException).
1.1.0 #
- Added
JsonHttpResponseextension onhttp.Response(isJson,decodeJson<T>(),tryDecodeJson<T>()) so JSON response helpers can be used on anyhttp.Response, not just those produced bySleekHttpClient.
1.0.0 #
- BREAKING Replaced
HttpRetryPolicy/HttpRetryPolicyBuilder/TokenRefreshHandlerandHttpClientLogConfig(logConfig) with a single composableHttpInterceptorchain (SleekHttpClient.interceptors), includingTokenRefreshInterceptorandLoggingInterceptor. - BREAKING
send<T>/sendMultipartRequest<T>now returnTinstead ofT?.T's own nullability drives behavior forJsonObject/JsonList:send<JsonObject>()requires a non-null body and throws the newNullResponseBodyExceptionif the server returns JSONnull, whilesend<JsonObject?>()returnsnullin that case. A malformed body or unexpected JSON shape always throws (FormatException/TypeError), regardless of nullability — it is no longer silently swallowed tonull.
0.1.0 #
- Initial release