← Back to all sparks
H

httr2

DEVOPS
Velocity2.5

Modern HTTP client for R with a pipeable request API, retries and OAuth support

httr2 is growing production concerns: tracing, throttling and token hygiene.

rhttp-clientoauthopentelemetryobservability
Current state
httr2 is the tidyverse's modern HTTP client and the designated successor to httr. Recent releases have moved past request-building ergonomics into operational concerns — OpenTelemetry traces for every request, throttling that behaves correctly across repeated calls, and a fix for OAuth token caches that were never actually being pruned.
Where it's heading
The package is maturing into infrastructure for long-running R services rather than interactive scripts. The 1.2.0 lifecycle purge removed deprecated streaming and mocking APIs in favour of a connection-based model, and debugging affordances like httr2_translate() point at users who need to reproduce a failing request outside R.
Prediction
Expect further observability and credential-handling work, with the rlang-driven cache hash change in 1.3.0 likely to surface follow-up issues as existing caches silently invalidate.

Recent moves

  1. 29d ago

    httr2 1.3.0 fixes OAuth token caches that never expired

    Fixes an OAuth cache bug worth understanding: the pruning pattern matched an unencrypted .rds file that was never written, so encrypted tokens were retained indefinitely regardless of age. Requiring rlang 1.3.0 also changes the hash naming cached files, meaning existing request and token caches will be treated as absent.

    View source ↗
  2. 1mo ago

    httr2 1.2.3 translates requests into curl commands

    Debugging and testing get real attention: httr2_translate() converts a request into the equivalent curl command, and mocked or cached responses now carry the originating request in resp$request like real ones. Token refresh also forwards token_params from the original flow, fixing providers that need extra parameters.

    View source ↗
  3. 8mo ago

    httr2 1.2.2 emits OpenTelemetry traces for every request

    ⚡ SPARK

    The release that puts httr2 into the observability stack, emitting OpenTelemetry traces for every request. Paired with genuine throttling fixes, it marks the shift from interactive convenience toward running inside production services.

    View source ↗
  4. 1y ago

    httr2 1.2.1 stops escaping colons in paths

    Colons in paths are no longer escaped. A single-line correctness fix for URL construction.

    View source ↗
  5. 1y ago

    httr2 1.2.0 removes deprecated mocking and streaming APIs

    A lifecycle release that clears out the past: req_perform_stream() is soft-deprecated for the connection-based req_perform_connection(), and previously deprecated functions like multi_req_perform(), with_mock() and local_mock() are removed outright along with several arguments. Breaking, but it settles the streaming and mocking story.

    View source ↗
  6. 1y ago

    httr2 1.1.2 fixes AWS request signing and header checks

    Stricter input type checking in req_headers() and a fix for AWS request signing failing with a missing cache argument. Narrow corrections with no change in capability.

    View source ↗