httr2
1.3.0Perform HTTP Requests and Process the Responses
Overview
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.
- Fixed OAuth token cache pruning so that it actually matches the encrypted
.rds.encfiles written to disk; previously the pruning pattern only matched an unencrypted.rdsfile 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. fromreq_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 (viatools::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 anexpiry_marginargument 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
- 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
Documentation
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%
- httr2 HTML
Downloads
Repository
- 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
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
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.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-08 · The repository has a site deploy workflow
pkgdown site last built 2026-07-14
Show all practicesHide 1 practice
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2025-12-04Seen in the repository: .claudeNamed in .Rbuildignore: .claudePull request it wrote: opened by a project memberCommits: at least 1 crediting it in the message
- Claude CodePull requests: 1 from outside contributors, first on 2026-09-07, 1 from forks
- Claude Opus 51 commit · Sep 2026
Dependencies
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.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 460 more dependents and 61 packages that suggest it on CRAN ↗
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 1.3.0Latest
- 1.2.3
- RR 4.6.0 released · 2026-04-24
- 1.2.2
- 1.2.12025-07-22 · diff ↗
- 1.2.02025-07-13 · diff ↗ ·
removed 4 exports
local_mock, multi_req_perform, req_stream, with_mockadded 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 - RR 4.5.0 released · 2025-04-11
- 1.1.22025-03-26 · diff ↗
- 1.1.1
- 1.1.02025-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
- 1.0.6
- 1.0.52024-09-26 · diff ↗
- 1.0.42024-09-14 · diff ↗ ·
added 5 exports
req_cookies_set, req_perform_connection, resp_stream_lines, resp_stream_raw, resp_stream_sse - 1.0.3
- 1.0.22024-07-16 · diff ↗
Show 12 earlier eventsHide 12 earlier events
- RR 4.4.0 released · 2024-04-24
- 1.0.12024-04-01 · diff ↗
- 1.0.02023-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
- RR 4.3.0 released · 2023-04-21
- 0.2.22022-09-25 · diff ↗
- 0.2.12022-05-11 · diff ↗
- 0.2.0
- RR 4.2.0 released · 2022-04-22
- 0.1.12021-09-28 · diff ↗
- 0.1.02021-09-22
- RR 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
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("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.
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.