Skip to content

httptest

4.2.4Package record

A Test Environment for HTTP Requests

1packages dependsuggested by 53
44.4Kdownloads / year
98.0%test coverage
13/13flavors OK

Overview

About

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.

Changes in 4.2.4
  • Fix for upcoming CRAN deprecated arguments (#95, #96)

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 2.0 min · r-oldrel-macos-x86_64
Status changes
  • 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
Advisories

none known

Documentation

In release 4.2.4
READMEYes · 1,113 wordsVignettesYes · 4 · dynamicNEWSYes · 100% structured · mentions 4.2.4Citation fileNoWebsiteYes
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

44.4K
CRAN downloads in the past year
Rank #2,075 · ~122/day · ~3.7K/mo
Daily download trend is not available in this view yet.
2.4K30 days
8.6K90 days
44.4K1 year
Compare downloads with other packages →
Also on221 r2u5 autocran145 c2d4u

Repository

83Stars
14Forks
15Open issues
0Open PRs
7Releases
257Commits
14Commit identities
httptest-frameworkmockrstats
257 commits · Last activity 2026-07-31 · 0% stars, 30d
Responsiveness
How these are sampled
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

2025-10-12 · 822026-07-07 · 83
PracticesBeta

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.

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 (1)
pkgdown
Coverage (1)
Coverage reporting
Reproducibility and dev environment (1)
Makefile
Show all practicesHide 1 practice
Automation and maintenance (1)
Dependabot
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
10 external dependencies (excludes base and recommended)

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.

Depends (2)
R >= 3.5.0testthat
Imports (6)
LinkingTo (0)
none
Enhances (0)
none

People & History

People (3)
Author, Maintainer since 1.0.0 (2016)
Contributor · added in 4.0.0
Contributor · added in 4.0.0
Releases (21)

Pick two releases to compare their code metrics.

  • 4.2.4Latest
    record
    2026-08-21 · current release · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • 4.2.3
    record
    2025-11-15 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 4.2.2
    record
    2024-01-23 · diff ↗
  • 4.2.1
    record
    2023-06-12 · diff ↗
  • 4.2.0
    record
    2023-05-29 · diff ↗ ·
    added 1 export
    get_current_requester
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • 4.1.0
    record
    2021-09-22 · diff ↗ ·
    removed 1 export
    with_mock_API
  • R
    R 4.1.0 released · 2021-05-18
  • 4.0.0
    record
    2021-02-01 · diff ↗ ·
    removed 2 exports
    buildMockURL, with_fake_HTTP
    added 1 export
    with_mock_dir
  • R
    R 4.0.0 released · 2020-04-24
  • 3.3.0
    record
    2020-01-28 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
Show 16 earlier eventsHide 16 earlier events
  • 3.2.2
    record
    2018-12-07 · diff ↗
  • 3.2.0
    record
    2018-11-09 · diff ↗ ·
    added 1 export
    use_httptest
  • 3.1.0
    record
    2018-06-19 · diff ↗ ·
    removed 3 exports
    fakeResponse, redact_http_auth, redact_oauth
  • R
    R 3.5.0 released · 2018-04-23
  • 3.0.0
    record
    2018-01-16 · diff ↗ ·
    removed 1 export
    redact_HTTP_auth
    added 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.4
    record
    2017-11-14 · diff ↗
  • 2.3.2
    record
    2017-10-20 · diff ↗ ·
    removed 1 export
    fakeDownload
    added 6 exports
    redact_HTTP_auth, redact_auth, redact_cookies, redact_headers, redact_oauth, within_body_text
  • 2.1.2
    record
    2017-08-05 · diff ↗
  • 2.1.0
    record
    2017-07-31 · diff ↗
  • 2.0.0
    record
    2017-06-05 · diff ↗ ·
    added 2 exports
    .mockPaths, fakeDownload
  • R
    R 3.4.0 released · 2017-04-21
  • 1.3.0
    record
    2017-04-13 · diff ↗ ·
    added 4 exports
    capture_requests, start_capturing, stop_capturing, with_trace
  • 1.2.0
    record
    2017-03-22 · diff ↗
  • 1.1.0
    record
    2017-02-03 · diff ↗ ·
    added 1 export
    expect_header
  • 1.0.0
    record
    2016-12-31
  • R
    R 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
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("httptest")
Richardson, N., Keane, J., & Salmon, M. (2026). httptest: A Test Environment for HTTP Requests (Version 4.2.4) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

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

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.

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