via 1.4.3
via: ^1.4.3 copied to clipboard
A modern, type-safe HTTP client library for Dart/Flutter applications.
Changelog #
All notable changes to this project will be documented in this file.
1.4.3 #
Fixed #
- Isolate Stability: Explicitly detaching the request object from the response before returning from an isolate. This prevents "Illegal argument in isolate message" errors caused by unsendable
ByteStreamreferences inMultipartRequest. - Improved Isolate Safety: Replaced the null request detachment with a lightweight
http.Requestdummy to preserve basic metadata (URL, Method). - Auto Isolate Bypass: Added automatic Isolate bypass for requests containing
Streambodies orCancelTokens, which are naturally unsendable between isolates.
Changed #
- API Simplification: Removed
ViaCallwrapper. Standard HTTP methods now returnFuture<ViaResult>directly. - Dedicated Streaming API: Introduced
via.stream()method which returnsFuture<ViaResultStream>. This allows accessing status codes and headers before consuming the response stream.
1.4.1 #
Added #
- Fluent API with ViaCall: Introduced
ViaCallwhich implementsFuture, allowing directawait via.get()while providing a.streamgetter for byte streaming. - Streaming Response Support: Added real-time byte streaming with
.streamgetter on any request. - Improved Result Buffering:
ViaResultnow handles lazy buffering, allowing both streaming and future-based body access on the same result. - Pipeline onStream Support: Added
onStreamhook toViaPipelinefor intercepting or transforming data chunks in real-time without blocking the stream. - New Example: Added
example/stream_response.dartto demonstrate the new streaming capabilities.
Changed #
- Modern Dart Syntax: Adopted modern Dart enum member access (e.g.,
.getinstead ofViaMethod.get). - Isolate Safety: Refactored
ViaResultto be isolate-friendly by lazily initializing non-sendable fields likeCompleter. - API Cleanup: Removed redundant
isStreamflags and explicitvia.stream()methods in favor of the more intuitive.streamgetter on any call.
1.3.0 #
Added #
- Multipart Upload Support: Dedicated
via.multipart()method for form-data and file uploads. - WebSocket Support: Introduced
ViaSocketfor lightweight and flexible WebSocket connections. - WebSocket Pipelines: Added
ViaSocketPipelinefor intercepting lifecycle events. - WebSocket Auto-Reconnect: Support for
autoReconnectandreconnectDelay. - Smart URI Conversion: Automatic
http/httpstows/wssconversion. - Examples: Added
multipart_example.dart,socket_example.dart, andsocket_reconnect_test.dart.
Changed #
- API Simplification: Shorthand methods (
post,put,patch,delete) now only handle standard bodies. All file uploads must usevia.multipart(). - Internal Refactoring: Moved HTTP methods to
ViaMethodsmixin and organized pipelines intosrc/features/pipelines/. - Removed
part/part ofstructure in favor of standard imports.
1.2.4 #
Changed #
- Refactored HTTP methods to use the
ViaMethodenum for better type safety and consistency. - Updated
ViaRequest.toCurl()andViaRequest.toString()to correctly use enum values. - Internal cleanup of method parameter types across the library.
1.2.3 #
Changed #
- Internal cleanup: Removed redundant generic type parameters from
ViaExecutorandViaRetry. - Simplified internal execution flow by centralizing type casting in the
Viaclass. - Improved code maintainability by reducing generic boilerplate in core feature classes.
- Updated all examples to support sequential execution via
Future<void> main(). - Improved
example/main.dartto act as a comprehensive test runner for all features. - Enhanced
example/pipeline.dartwith a custom logger for better visibility.
1.2.2 #
Fixed #
- Further improved
toCurlcharacter escaping by using single quotes for headers and URL to prevent shell interpretation issues. - Fixed
toJsoninViaResultto correctly handle null-aware response properties. - Added
responseobject toViaExceptioninViaResponseValidatorPipelinefor better debugging.
1.2.1 #
Fixed #
- Fixed
toJsonandtoCurlimplementations inViaRequest. - Improved cURL command generation with better character escaping for terminal compatibility.
- Fixed
ViaExceptionJSON serialization by correcting null-aware syntax. - Adopted modern Dart null-aware map entries syntax (
?variable) for cleaner metadata.
1.2.0 #
Changed #
- Refactored
ViaPipelineto be non-generic for better flexibility and simplicity. - Removed generic requirements from all built-in pipelines (
ViaLoggerPipeline,ViaCachePipeline, etc.). - Simplified custom result transformation by removing
covariantcomplexity in favor of standard inheritance.
1.1.0 #
1.0.0 #
Added #
- Initial release of the Via HTTP engine.
Viaclass for high-level HTTP operations.ViaExecutorwith support forViaPipelinearchitecture.- Built-in resilience with
ViaRetry(automatic retries). - Request cancellation support via
CancelToken. - Type-safe JSON parsing helpers (
asMap,asList). - Memory-managed
ViaCachePipeline(FIFO withmaxEntries). - Advanced pipelines:
ViaLoggerPipeline(with cURL support),ViaDebouncePipeline,ViaThrottlePipeline, andViaResponseValidatorPipeline. - Connection pooling support with shared
http.Client. - Isolate-based execution support for background processing.
errorIfvalidation inViaExecutorto treat HTTP responses as errors (defaults to non-2xx).