v0.8.0-rc.0
Pre-releaseReq 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: AddReq.stream/4. -
Req: Allow setting private through options, e.g.:Req.new(private: %{foo: :bar}). -
Req: Support request body streaming withbody: fun -
Req.Response: Addresp.request. This is useful to inspect the final request after all steps have executed. -
Req.Decode: Support NDJSON -
Req.Decode: Support SSE -
Req.Decode: Supportdecoders: [{content_type, decoder}].
Breaking Changes
- Remove jason dependency.
Req.post(url, json: term)will now useJSON.encode!/2, notJason.encode!/2, that is,termmust implementJSON.Encoderprotocol. - Remove deprecated
:finch_requestoption - Remove deprecated
into: :legacy_self - Remove deprecated
cachestep - Replace
compressedanddecompress_bodywithReq.Decompress. - Replace
handle_http_errorswithReq.Expect. - Replace
authandhttp_digeststeps withReq.Auth. - Replace
redirectwithReq.Redirect - Replace
retrywithReq.Retry - Replace
checksumwithReq.Checksum - Replace
decode_bodywithReq.Decode
Deprecations
Req: Deprecateinto: funin favour ofReq.stream/4.Req.Expect: Deprecate:http_errorsoption in favour of:expect.