A Test Environment for HTTP Requests
Overview
Testing and documenting code that communicates with remote servers can be painful. Dealing with authentication, server state, and other complications can make testing seem too costly to bother with. But it doesn't need to be that hard. This package enables one to test all of the logic on the R sides of the API in your package without requiring access to the remote service. Importantly, it provides three contexts that mock the network connection in different ways, as well as testing functions to assert that HTTP requests were---or were not---made. It also allows one to safely record real API responses to use as test fixtures. The ability to save responses and load them offline also enables one to write vignettes and other dynamic documents that can be distributed without access to a live server.
- Fix for upcoming CRAN deprecated arguments (#95, #96)
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-26
- NOTE11 OK, 2 NOTE2026-08-23
- WARNING9 OK, 3 NOTE, 1 WARNING2026-08-22
- NOTE11 OK, 2 NOTE2026-07-16
- OK13 OK2026-06-09
Show 2 earlier changesHide 2 earlier changes
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 30 (6 internal)includes a package overview page
- Examples that run
- 83%5 run in a plain check · 1 never run
- Exported functions with examples
- 21%
- Documented parameters
- 98%
- Return-value docs
- 96%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 97%
- Median days to close, 50 most recently updated closed issues
- 4
- 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
6 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/nealrichardson/httptest on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Show all practicesHide 1 practice
Dependencies
Installing httptest adds 31 packages (17 with compiled code, 8.8 MB of source tarballs). Heaviest: fs 1.4 MB, openssl 1.1 MB, jsonlite 1.0 MB.
Show the 48 most downloaded packagesHide the 48 most downloaded packages
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 4.2.4Latest
- RR 4.6.0 released · 2026-04-24
- 4.2.32025-11-15 · diff ↗
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 4.2.22024-01-23 · diff ↗
- 4.2.12023-06-12 · diff ↗
- 4.2.0
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- 4.1.0
- RR 4.1.0 released · 2021-05-18
- 4.0.0
- RR 4.0.0 released · 2020-04-24
- 3.3.02020-01-28 · diff ↗
- RR 3.6.0 released · 2019-04-26
Show 16 earlier eventsHide 16 earlier events
- 3.2.22018-12-07 · diff ↗
- 3.2.0
- 3.1.0
- RR 3.5.0 released · 2018-04-23
- 3.0.02018-01-16 · diff ↗ ·
removed 1 export
redact_HTTP_authadded 18 exports
block_requests, build_mock_url, change_state, end_vignette, fake_response, find_mock_file, get_current_redactor, gsub_request, gsub_response, redact_http_auth, save_response, set_redactor, set_requester, start_vignette, stop_mocking, use_mock_api, with_fake_http, with_mock_api - 2.3.42017-11-14 · diff ↗
- 2.3.22017-10-20 · diff ↗ ·
removed 1 export
fakeDownloadadded 6 exports
redact_HTTP_auth, redact_auth, redact_cookies, redact_headers, redact_oauth, within_body_text - 2.1.22017-08-05 · diff ↗
- 2.1.02017-07-31 · diff ↗
- 2.0.0
- RR 3.4.0 released · 2017-04-21
- 1.3.0
- 1.2.02017-03-22 · diff ↗
- 1.1.0
- 1.0.02016-12-31
- RR 3.3.0 released · 2016-05-03
Package metadata
- First published
- 2016-12-31
- Total releases
- 21 / 10 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.5.0
- Download size
- 118 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("httptest")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-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.