Skip to content

0.2.0

Choose a tag to compare

@salasebas salasebas released this 27 May 09:04
· 33 commits to main since this release

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

  • CancellationCancellationToken (from tokio-util), RequestBuilder::cancellation_token(), and Error::Cancelled with cooperative abort during requests and retry backoff.
  • Throw modeRequestBuilder::throw_on_error(true) returns Err on non-2xx from send() (like upstream throw: true).
  • Form bodiesRequestBuilder::form([...]) for application/x-www-form-urlencoded.
  • MultipartRequestBuilder::multipart(form) behind the multipart feature; re-export better_fetch::multipart for reqwest::multipart::Form.
  • Typed endpointsEndpointRequestBuilder via client.call::<E>(), with EndpointParams / EndpointQuery and typed send_json().
  • RetryRetry-After header support, jitter on backoff, 408 in default retry codes; RetryPolicy::Count keeps with_should_retry without converting to linear.
  • PluginsPreparedRequest now includes method and headers in init (after auth).
  • Dependenciesindexmap (stable query order), tokio-util, fastrand (lightweight).
  • Example multipart and integration tests for cancel, throw, form, multipart, query order, and retry edge cases.

Changed

  • ClientBuilder::build() — requires .base_url(...); returns Error::MissingBaseUrl instead of defaulting to http://localhost (breaking).
  • Query parameters — stored in IndexMap so URL query strings follow insertion order.
  • HttpBackend::execute — takes HttpRequest by 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