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

HTTP client foundation for Dart built on monart. Create typed HTTP service objects using Railway-Oriented Programming with semantic outcomes per status code.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.2.1 - 2026-04-20 #

Changed #

  • Widened monart constraint from ^0.1.1 to >=0.1.1 <1.0.0 so that minor releases of monart (e.g. 0.2.0, 0.3.0) resolve without requiring a new monart_http release.

0.2.0 - 2026-04-16 #

Added #

  • HttpLogger interface — inject any logging backend via HttpClientConfiguration.logger. Implement logRequest, logResponse, and logError to forward to Sentry, package:logging, or any other sink.

  • NullHttpLogger — no-op implementation, used as the default logger.

  • DevToolsHttpLogger — logs // entries with method, URI, status, elapsed time, and request/response bodies to the Flutter DevTools Logging tab via dart:developer. Logs are ephemeral and never appear in production builds.

  • HttpCache interface — inject any caching backend via HttpClientConfiguration.cache. Implement fetch to cache responses in Hive, Redis, or any other store.

  • NullHttpCache — always executes the request, used as the default cache.

  • InMemoryHttpCache — Map-based cache with configurable TTL (default 5 min). Expired entries are evicted on the next access to the same key.

Changed #

  • HttpClientConfiguration now accepts logger (HttpLogger) and cache (HttpCache) instead of the removed logStrategy and cacheStrategy enums. The cacheExpiresIn parameter has also been removed — pass expiresIn directly to InMemoryHttpCache instead.

Removed #

  • LogStrategy enum — replaced by the HttpLogger interface.
  • CacheStrategy enum — replaced by the HttpCache interface.
  • HttpLogInterceptor — superseded by DevToolsHttpLogger and the injectable HttpLogger contract.

0.1.1 - 2026-04-17 #

Fixed #

  • Bumped dio lower bound from 5.0.0 to 5.2.0, where DioException was introduced. The previous constraint allowed resolving dio 5.0.0–5.1.x, which still used the old DioError name and caused compilation failures on lower-bound analysis.

0.1.0 - 2026-04-17 #

Added #

  • HttpClientConfiguration — shared configuration per HTTP client: base URI, default headers, connect/receive timeouts, and log strategy.

  • LogStrategy enum — none (default) or stdout (logs to Flutter DevTools).

  • HttpMethod enum — get, post, put, patch, delete.

  • HttpResponse — thin wrapper around the raw Dio response exposing statusCode, statusMessage, body, and headers.

  • HttpServiceBase<Value> — abstract base class for typed HTTP service objects. Subclass and declare method, pathTemplate, configuration, and fromResponse. Optional overrides: pathParams, headers, queryParams, body. Calling runAsync() dispatches the request and returns Future<Result<Value>>.

  • ResponseProcessor — maps HTTP status codes to semantic outcome names (e.g. 404['notFound', 'clientError'], 422['unprocessableContent', 'clientError']). Unrecognised codes fall back to family-level outcomes based on their range.

  • ExceptionProcessor — maps Dio and network exceptions to outcome names: timeout, sslError, connectionError, requestCancelled, uncaughtError.

  • HttpLogInterceptor — logs // entries with method, URI, status, elapsed time, and request/response bodies to the Dart developer console (Flutter DevTools Logging tab). Activated via LogStrategy.stdout.

0
likes
160
points
198
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

HTTP client foundation for Dart built on monart. Create typed HTTP service objects using Railway-Oriented Programming with semantic outcomes per status code.

Repository (GitHub)
View/report issues

Topics

#http #networking #railway-oriented-programming #service-objects

License

MIT (license)

Dependencies

collection, dio, http_status, meta, monart

More

Packages that depend on monart_http