Skip to content

httr2

1.3.0

Perform HTTP Requests and Process the Responses

508packages dependsuggested by 61
4.7Mdownloads / year
–test coverage
13/13flavors OK

Overview

About

Tools for creating and modifying HTTP requests, then performing them and processing the results. 'httr2' is a modern re-imagining of 'httr' that uses a pipe-based interface and solves more of the problems that API wrapping packages face.

Changes in 1.3.0
  • Fixed OAuth token cache pruning so that it actually matches the encrypted .rds.enc files written to disk; previously the pruning pattern only matched an unencrypted .rds file that was never created, so cached tokens were never automatically deleted regardless of age.
  • httr2 now requires rlang >= 1.3.0, which changes the hash used to name files cached by req_cache() and on-disk OAuth token caches (e.g. from req_oauth_auth_code(cache_disk = TRUE)). Existing cached files won't match the new hash, so they'll be silently ignored (triggering a normal cache miss/re-authentication) and cleaned up over time by the usual pruning rules; you can also delete them manually.
  • oauth_cache_path() now defaults to a standard R cache directory (via tools::R_user_dir()). Because this release also changes the hash used for cache filenames, existing OAuth tokens will generally not be reused and you may need to authenticate once after upgrading. New tokens are written to the new location, and obsolete tokens in both the old and new locations are removed by the usual pruning rules. httr2 no longer requires the rappdirs package (#800).
  • New oauth_cache_prune() lets you manually delete cached OAuth tokens older than a given number of days, exposing the pruning that httr2 already performs automatically on load.
  • req_oauth_*() gains an expiry_margin argument to control how early cached OAuth tokens are treated as expired; the default margin increases from 5 to 30 seconds (@zacdav-db, #860).

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 3.7 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-10-10
  • ERROR12 OK, 1 ERROR2026-10-09
  • OK13 OK2026-08-29
  • ERROR12 OK, 1 ERROR2026-08-28
  • OK13 OK2026-08-20
Show 16 earlier changesHide 16 earlier changes
  • ERROR12 OK, 1 ERROR2026-08-18
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-07-03
  • ERROR12 OK, 1 ERROR2026-07-01
  • OK13 OK2026-06-11
  • ERROR12 OK, 1 ERROR2026-06-01
  • OK13 OK2026-05-22
  • ERROR12 OK, 1 ERROR2026-05-21
  • OK13 OK2026-05-06
  • ERROR11 OK, 2 ERROR2026-05-04
  • OK14 OK2026-04-24
  • ERROR13 OK, 1 ERROR2026-04-23
  • OK14 OK2026-03-26
  • ERROR13 OK, 1 ERROR2026-03-25
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 1.3.0
READMEYes · 388 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 1.3.0Citation fileNoWebsiteYes · pkgdown

The repository also keeps web-only articles.

Help pages
87 (10 internal)includes a package overview page
Examples that run
96%69 run in a plain check (2 of them under a condition) · 3 never run
Exported functions with examples
85%
Documented parameters
91%
Return-value docs
73%
Help pages citing references
0%
Vignettes (1)

Downloads

4.7M
CRAN downloads in the past year
Rank #153 · ~13K/day · ~395.3K/mo
Daily download trend is not available in this view yet.
368.5K30 days
1.1M90 days
4.7M1 year
Compare downloads with other packages →
Also on157.7K r2u12 autocran375K conda_forge2.7K c2d4u

Repository

r-lib/httr2 ↗Organization: r-lib
272Stars
91Forks
22Open issues
9Open PRs
22Releases
828Commits
67Commit identities
rhttp
828 commits · Last activity 2026-10-08 · +0.7% stars, 30d · Default branch at 1.3.0.9000, ahead of CRAN 1.3.0 (checked 2026-10-11)
Responsiveness
How these are sampled
PRs merged (all time)
90%
Median days to close, 50 most recently updated closed issues
16
Median days to close, 50 most recently updated closed PRs
1

Stars over time

2025-10-03 · 2542026-10-03 · 272
PracticesBeta

13 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/r-lib/httr2 on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-08 · The repository has a site deploy workflow

pkgdown site last built 2026-07-14

Coverage (1)
Coverage reporting (Codecov)
CRAN release process (2)
cran-comments.mdrevdep/
Show all practicesHide 1 practice
Lint, format, editor (4)
Lint workflowAirVS CodeRStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2025-12-04
    Seen in the repository: .claude
    Named in .Rbuildignore: .claude
    Pull request it wrote: opened by a project member
    Commits: at least 1 crediting it in the message
Shared conventions any agent may read, so they name no particular tool.
Seen in the repository: AGENTS.md
From outside contributors
  • Claude Code
    Pull requests: 1 from outside contributors, first on 2026-09-07, 1 from forks
Models named in its commits
  • Claude Opus 51 commit · Sep 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
32 external dependencies (excludes base and recommended)

Installing httr2 adds 12 packages (9 with compiled code, 4.8 MB of source tarballs). Heaviest: openssl 1.1 MB, vctrs 1.0 MB, rlang 766 KB.

Depends (1)
R >= 4.1
LinkingTo (0)
none
Enhances (0)
none

People & History

People (3)
Author, Maintainer since 0.1.0 (2021)
Contributor · added in 1.0.0
Copyright holder, Funder · added in 1.0.2
Listed in earlier versions (1)
RStudio
no longer listed · 0.1.0 to 1.0.1
Releases (22)

Pick two releases to compare their code metrics.

  • 1.3.0Latest
    record
    2026-07-13 · current release · diff ↗ ·
    added 1 export
    oauth_cache_prune
  • 1.2.3
    record
    2026-06-23 · diff ↗ ·
    added 2 exports
    httr2_translate, oauth_server_metadata
  • R
    R 4.6.0 released · 2026-04-24
  • 1.2.2
    record
    2025-12-08 · diff ↗ ·
    added 1 export
    resps_ok
  • 1.2.1
    record
    2025-07-22 · diff ↗
  • 1.2.0
    record
    2025-07-13 · diff ↗ ·
    removed 4 exports
    local_mock, multi_req_perform, req_stream, with_mock
    added 10 exports
    StreamingBody, last_request_json, last_response_json, new_response, req_get_body, req_get_body_type, req_get_headers, req_get_method, req_get_url, resp_timing
  • R
    R 4.5.0 released · 2025-04-11
  • 1.1.2
    record
    2025-03-26 · diff ↗
  • 1.1.1
    record
    2025-03-08 · diff ↗ ·
    added 1 export
    local_verbosity
  • 1.1.0
    record
    2025-01-18 · diff ↗ ·
    added 10 exports
    is_online, req_headers_redacted, req_url_relative, resp_request, resp_stream_is_complete, url_modify, url_modify_query, url_modify_relative, url_query_build, url_query_parse
  • 1.0.7
    record
    2024-11-27 · diff ↗ ·
    added 2 exports
    oauth_flow_token_exchange, req_oauth_token_exchange
  • 1.0.6
    record
    2024-11-04 · diff ↗ ·
    added 3 exports
    oauth_cache_clear, req_auth_aws_v4, resp_stream_aws
  • 1.0.5
    record
    2024-09-26 · diff ↗
  • 1.0.4
    record
    2024-09-14 · diff ↗ ·
    added 5 exports
    req_cookies_set, req_perform_connection, resp_stream_lines, resp_stream_raw, resp_stream_sse
  • 1.0.3
    record
    2024-08-22 · diff ↗ ·
    added 1 export
    req_perform_promise
  • 1.0.2
    record
    2024-07-16 · diff ↗
Show 12 earlier eventsHide 12 earlier events
  • R
    R 4.4.0 released · 2024-04-24
  • 1.0.1
    record
    2024-04-01 · diff ↗
  • 1.0.0
    record
    2023-11-14 · diff ↗ ·
    added 30 exports
    example_github_client, iterate_with_cursor, iterate_with_link_url, iterate_with_offset, local_mocked_responses, oauth_cache_path, oauth_redirect_uri, oauth_token_cached, req_body_json_modify, req_cookie_preserve, req_perform_iterative, req_perform_parallel, req_perform_sequential, req_perform_stream, req_progress, resp_check_content_type, resp_has_body, resp_url, resp_url_path, resp_url_queries, resp_url_query, response_json, resps_data, resps_failures, resps_requests, resps_successes, secret_decrypt_file, secret_encrypt_file, signal_total_pages, with_mocked_responses
  • 0.2.3
    record
    2023-05-08 · diff ↗ ·
    added 2 exports
    example_url, throttle_status
  • R
    R 4.3.0 released · 2023-04-21
  • 0.2.2
    record
    2022-09-25 · diff ↗
  • 0.2.1
    record
    2022-05-11 · diff ↗
  • 0.2.0
    record
    2022-04-29 · diff ↗ ·
    added 1 export
    req_proxy
  • R
    R 4.2.0 released · 2022-04-22
  • 0.1.1
    record
    2021-09-28 · diff ↗
  • 0.1.0
    record
    2021-09-22
  • R
    R 4.1.0 released · 2021-05-18

Package metadata

First published
2021-09-22
Total releases
22 / 5 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1
Download size
295 KB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("httr2")
Wickham, H., Posit Software, PBC, & Girlich, M. (2026). httr2: Perform HTTP Requests and Process the Responses (Version 1.3.0) [Computer software]. https://doi.org/10.32614/CRAN.package.httr2

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for httr2 version 1.3.0 [Data set]. HJJB, LLC. Data release v2026-10-17. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy