github wojtekmach/req v0.8.0-rc.0

pre-release4 hours ago

Req v0.8 brings more ergonomic streaming with Req.stream/4, streaming decompression and decoding, automatic NDJSON & SSE decoding, and more.

Req v0.8 has revamped internals though most end-users should be unaffected. Req's initial design included response/error steps which are now deprecated as we couldn't use them for extensible streaming decoding. Instead, we're adding step wrappers.
See "Steps & Step Wrappers" section in Req.Request module documentation for more information.

Req v0.8 requires Elixir 1.18+.

Enhancements

  • Req: Add Req.stream/4.

  • Req: Allow setting private through options, e.g.: Req.new(private: %{foo: :bar}).

  • Req: Support request body streaming with body: fun

  • Req.Response: Add resp.request. This is useful to inspect the final request after all steps have executed.

  • Req.Decode: Support NDJSON

  • Req.Decode: Support SSE

  • Req.Decode: Support decoders: [{content_type, decoder}].

Breaking Changes

  • Remove jason dependency. Req.post(url, json: term) will now use JSON.encode!/2, not Jason.encode!/2, that is, term must implement JSON.Encoder protocol.
  • Remove deprecated :finch_request option
  • Remove deprecated into: :legacy_self
  • Remove deprecated cache step
  • Replace compressed and decompress_body with Req.Decompress.
  • Replace handle_http_errors with Req.Expect.
  • Replace auth and http_digest steps with Req.Auth.
  • Replace redirect with Req.Redirect
  • Replace retry with Req.Retry
  • Replace checksum with Req.Checksum
  • Replace decode_body with Req.Decode

Deprecations

Don't miss a new req release

NewReleases is sending notifications on new releases.