oxy 0.5.0
oxy: ^0.5.0 copied to clipboard
Policy-first HTTP client for Dart and Flutter apps, SDKs, and reusable API clients.
0.5.0 #
Breaking Changes #
- Reworked
Headersas a directht.Headersre-export. Oxy-specific helpers such asgetAll,copy, andtoMultiValueMapare no longer available; useentries(),Headers(headers), andgetSetCookie()instead. - Removed
Request.withHeader; useRequest.copyWith(headers: ...)withHeaders(request.headers)when deriving requests with changed headers. - Replaced Oxy's local cookie jar API with
ocookie 0.3.0primitives.CookieMiddlewarenow creates an in-memory jar by default and accepts upstreamCookieJar,CookieStore, andCookiePolicyinputs through named parameters. - Removed Oxy's
MemoryCookieJar,parseSetCookie, and cookie request-matching extension APIs in favor of upstreamocookieprimitives. - Removed deprecated
ClientOptions.networkMiddlewareandRequestOptions.networkMiddleware; pass attempt middleware throughmiddlewareinstead.
Changed #
- Upgraded to
ht ^0.4.2and aligned header normalization and iteration with Fetch semantics. - Upgraded to
ocookie ^0.3.0and delegated cookie normalization, matching, sorting, and storage to upstreamocookie. - Removed
ht.Bodyas an accepted Oxy body source; use stable data containers such asBlobinstead.
0.4.0 #
Breaking Changes #
- Removed middleware presets; compose middleware explicitly from the built-in middleware types instead.
- Redesigned middleware around lifecycle capabilities.
Middleware.interceptandNextwere replaced by request, attempt, final response, error, and finally capability interfaces. - Deprecated
ClientOptions.networkMiddlewareandRequestOptions.networkMiddleware; configure common middleware through the primarymiddlewarelist instead.
Added #
- Added public API Dartdoc, a cookbook, and checked examples for reusable API clients, policies, no-throw flows, middleware, testing, and body replayability.
CookieMiddlewarenow works across redirects and retries from the primarymiddlewarelist.
0.3.0 #
Breaking Changes #
- Rebuilt Oxy around semantic core types:
Client,Request,Response,Headers,Body, policy types, middleware, typed errors, andResult. - Removed
ht.Request/ht.Responseas Oxy's public request model along with the oldOxy/OxyConfigAPI shape. - Replaced the
safe*method matrix with unified result flows:Result.capture(...),Client.sendResult(...),Client.requestResult(...), andfetchResult(...). - Status handling now uses
StatusPolicy; non-2xx responses throwStatusErrorby default.
Added #
- Built-in native, web, and test transports under Oxy's own single-package transport layer.
Contextwith typedAttributesfor middleware coordination.- Replayability-aware
BodyandResponseBodyprimitives. - Selective
htbody-helper integration forBlob,FormData,Multipart, andURLSearchParamswithout exposinght.Request/ht.Responseas Oxy's request model. - Hardened cookie scope validation, cache revalidation, browser forbidden headers, timeout enforcement, retry draining, and error-body preview handling.
- Added client-level native/test redirect following, explicit web redirect-limit
policy errors, JSON
nullrequest bodies, and stronger middleware error normalization. - Application and network middleware layers.
- Policy-driven timeout, retry, redirect, and status behavior.
MockTransportviapackage:oxy/testing.dart.
Changed #
- Native clients keep connections alive by default and expose explicit
Client.close()lifecycle management. - Middleware now works with immutable/copy-on-write requests instead of mutating shared request instances.
- Cache, cookie, auth, logging, and request-id features remain in the single package but sit behind the common middleware pipeline.
0.2.2 #
Fixed #
- Restored browser compatibility for non-stream request bodies by avoiding accidental request streaming on HTTP/1.1 endpoints.
- Preserved the intended web body transport mode for manual
send(Request(...))calls and hardened invalid internal body-mode metadata handling. - Added browser regression coverage for JSON POST requests and manual request-body mode handling.
0.2.1 #
Fixed #
- Raised the
htlower bound to^0.3.1to avoid resolving the brokenht 0.3.0release. - Updated Oxy request construction to match the corrected
ht 0.3.1Request(Object? input, [RequestInit? init])API. - Refreshed README snippets and public API tests for the
ht 0.3.1hotfix line.
0.2.0 #
Breaking Changes #
- Upgraded to
ht 0.3and aligned Oxy request/response APIs with the newhtrequest and response semantics. - Low-level request construction now follows the
ht 0.3model, includingRequestInput.*,RequestInit,HttpMethod, andHeadersInit-based inputs where applicable. - Middleware now forwards and mutates the active
Requestinstance instead of depending on copied request objects. Custom middleware that relied on copy-on-write behavior should update to mutate the provided request before callingnext. - Re-exported cookie types now follow
ocookie 0.2.0two-state flag semantics.Cookie.httpOnly,Cookie.secure, andCookie.partitionednow default tofalse, andCookieNullableField.httpOnly,CookieNullableField.secure, andCookieNullableField.partitionedare no longer available.
Changed #
- Upgraded dependencies to
ht ^0.3.0andocookie ^0.2.0. - Updated examples, README snippets, and test coverage for the
ht 0.3request construction model. - Aligned transport, cache, logging, auth, request ID, and cookie middleware behavior with the latest
htheader and response APIs.
Fixed #
- Preserved request
Cookieheader precedence over cookie jar values when merging cookies inCookieMiddleware. - Kept cookie parsing aligned with
ocookie 0.2.0, including explicitSecure=false,HttpOnly=false, andPartitioned=falseflag handling. - Removed unnecessary request copying inside the middleware pipeline while preserving request mutation behavior across built-in middleware.
0.1.0 #
Breaking Changes #
- Rewritten around
htwith a middleware-first architecture. - Removed adapter abstraction and old multi-package workspace layout.
- Removed deprecated subpackages and adapter APIs (
oxy_dio,oxy_http, olduse(...)adapter flow).
Added #
- Unified VM/Web transports with consistent request/response behavior.
- Middleware system with built-ins:
AuthMiddlewareCookieMiddleware+MemoryCookieJar(viaocookie)CacheMiddleware+MemoryCacheStoreLoggingMiddlewareRequestIdMiddleware
- Official presets:
OxyPresets.minimal(...)OxyPresets.standard(...)OxyPresets.full(...)
safe*APIs andOxyResultfor no-throw flows.- Rich request options: retry, timeout, abort signal, redirect policy, HTTP error policy.
Changed #
- Public API simplified to a single top-level package:
package:oxy/oxy.dart. - Examples, docs, and CI updated for the new architecture and browser coverage.
Fixed #
- Native/Web redirect semantics and redirect error handling alignment.
- Web request streaming compatibility (
duplex: 'half') and upload progress semantics. - Cache behavior edge cases (
no-cache/no-store, 304 revalidation merge safety, LRU bounds). - Cookie expiration/path matching correctness and cross-platform request ID randomness.
0.0.4 #
- First public preview.