Lifecycle changes
-
req_perform_stream()
is superseded in favor ofreq_perform_connection()
,
which is no longer experimental (#625). -
with_mock()
andlocal_mock()
are defunct and will be removed in the next
release.
New features
-
is_online()
wrapscurl::has_internet()
, making it easy to tell if you're
currently online (#512). -
req_headers_redacted()
makes it easier to redact sensitive headers (#561). -
req_retry()
implements "circuit breaking", which immediatelys error after
multiple failures to the same server (e.g. because the server is down)
(#370). -
req_url_relative()
navigates to a relative URL (#449). -
resp_request()
returns the request associated with a response; this can
be useful when debugging (#604). -
resp_stream_is_complete()
checks if data remains in the stream (#559). -
url_modify()
,url_modify_query()
, andurl_modify_relative()
modify
URLs (#464);url_query_parse()
andurl_query_build()
parse and build
query strings (#425).
Bug fixes and minor improvements
-
OAuth response parsing errors now have a dedicated
httr2_oauth_parse
error
class that includes the original response object (@atheriel, #596). -
curl_translate()
converts cookie headers toreq_cookies_set()
(#431)
and JSON data toreq_body_json_modify()
calls (#258). -
print.request()
escapes{}
in headers (#586). -
req_auth_aws_v4()
formats the AWS Authorization header correctly (#627). -
req_retry()
defaults tomax_tries = 2
when nethiermax_tries
nor
max_seconds
is set. If you want to disable retries, setmax_tries = 1
. -
req_perform_connection()
gains averbosity
argument, which is useful for
understanding exactly how data is streamed back to you (#599).
req_perform_promise()
also gains averbosity
argument. -
req_url_query()
can control how spaces are encoded with.space
(#432). -
resp_link_url()
handles multipleLink
headers (#587). -
resp_stream_sse()
will warn if it recieves a partial event. -
url_parse()
parses relative URLs with newbase_url
argument (#449) and
the uses faster and more correctcurl::curl_parse_url()
(#577).