0.2.0
Note: This release matches what was published to crates.io as 0.2.0 (~08:46 UTC). Items that landed only in git afterward are in 0.2.1 and 0.2.2.
Added
- Cancellation —
CancellationToken(fromtokio-util),RequestBuilder::cancellation_token(), andError::Cancelledwith cooperative abort during requests and retry backoff. - Throw mode —
RequestBuilder::throw_on_error(true)returnsErron non-2xx fromsend()(like upstreamthrow: true). - Form bodies —
RequestBuilder::form([...])forapplication/x-www-form-urlencoded. - Multipart —
RequestBuilder::multipart(form)behind themultipartfeature; re-exportbetter_fetch::multipartforreqwest::multipart::Form. - Typed endpoints —
EndpointRequestBuilderviaclient.call::<E>(), withEndpointParams/EndpointQueryand typedsend_json(). - Retry —
Retry-Afterheader support, jitter on backoff, 408 in default retry codes;RetryPolicy::Countkeepswith_should_retrywithout converting to linear. - Plugins —
PreparedRequestnow includesmethodandheadersininit(after auth). - Dependencies —
indexmap(stable query order),tokio-util,fastrand(lightweight). - Example
multipartand integration tests for cancel, throw, form, multipart, query order, and retry edge cases.
Changed
ClientBuilder::build()— requires.base_url(...); returnsError::MissingBaseUrlinstead of defaulting tohttp://localhost(breaking).- Query parameters — stored in
IndexMapso URL query strings follow insertion order. HttpBackend::execute— takesHttpRequestby value; client reuses one built request per attempt (no full clone per retry for byte bodies).ClientConfig— pre-merges plugin hooks at build time (merged_hooks).- Multipart + retry — automatic retry is rejected with a clear error if a multipart body was used (multipart forms are not cloneable).
Full notes: CHANGELOG.md