monart_http 0.1.0
monart_http: ^0.1.0 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.1.0 - 2026-04-17 #
Added #
-
HttpClientConfiguration— shared configuration per HTTP client: base URI, default headers, connect/receive timeouts, and log strategy. -
LogStrategyenum —none(default) orstdout(logs to Flutter DevTools). -
HttpMethodenum —get,post,put,patch,delete. -
HttpResponse— thin wrapper around the raw Dio response exposingstatusCode,statusMessage,body, andheaders. -
HttpServiceBase<Value>— abstract base class for typed HTTP service objects. Subclass and declaremethod,pathTemplate,configuration, andfromResponse. Optional overrides:pathParams,headers,queryParams,body. CallingrunAsync()dispatches the request and returnsFuture<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 viaLogStrategy.stdout.