Skip to content

httptest

4.2.3

A Test Environment for HTTP Requests

55packages depend
51.3Kdownloads / year
98.0%test coverage
8/13checks pass

Overview

About
Maintained by Neal RichardsonFirst published 2016-12-3120 releasesCRAN page ↗GitHub ↗

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.

Install

Health

CRAN checks
5NOTE8OK
Failing flavors
  • NOTE r-devel-linux-x86_64-debian-clang
  • NOTE r-devel-linux-x86_64-debian-gcc
  • NOTE r-devel-linux-x86_64-fedora-clang
  • NOTE r-devel-linux-x86_64-fedora-gcc
  • NOTE r-devel-windows-x86_64
Slowest check: 1.9 min · r-oldrel-windows-x86_64
Code health
Yes
Tests · ratio 1.44
98.0%
Coverage · measured lines
100%
Documentation · exports
7
Dependencies · direct
Check history
  • NOTE2026-07-16
    11 OK · 2 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • OK2026-06-09
    13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • ERROR2026-06-08
    12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
  • OK2026-03-10
    14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Documentation

Documentation
READMEYes · 1,113 wordsVignettesYes · dynamicpkgdown siteNoNEWSYes · 100% structuredCode of conductNoContributing guideNo
Examples that run
83%
Documented parameters
98%
Return-value docs
96%
References docs
0%

Downloads

51.3K
CRAN downloads in the past year
Rank #1,844 · ~140/day · ~4.3K/mo
Daily download trend is not available in this view yet.
3.9K30 days
14.2K90 days
51.3K1 year
Compare downloads with other packages →
Also on191 r2u30 autocran58 c2d4u

Repository

Repository
83Stars
12Forks
15Open issues
0Open PRs
6Releases
253Commits
12Contributors
httptest-frameworkmockrstats
253 commits · Last activity 2025-11-16 · 0% stars, 30d

Stars over time

2024-12-10 · 812026-07-07 · 83

Repository practices

Upstream repositoryBeta

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

Checks run against github.com/nealrichardson/httptest on 2026-07-19.

Continuous integration (1)
GitHub Actions
Reproducibility and dev environment (1)
Makefile
How this is detected·Detection ruleset v1 (2026-07-18)

Dependencies

Declared dependencies
10 external dependencies (excludes base and recommended)
Depends (2)
R >= 3.5.0testthat
Imports (6)
LinkingTo (0)
none
Enhances (0)
none

Code & Tests

Code Composition
R 4,499 (71%)Rd 1,170 (18%)Vignettes 650 (10%)JSON 31 (0%)Other 4 (0%)
Code characteristics
Cyclomatic complexity
2.0 median / 10 max
Test cases
136 / 1.44 per code line

Test coverage

Line coverage

98%

Expression

98.0%

Tests / Examples

98.0% / 27% ex

Functions

77 39 exported

Complexity

2.2 avg / 10 max

Call network

77 nodes / 98 edges

Loading call graph…

Lowest coverage

77 functions
FunctionCycloCoverage
save_response exp1082%
capture_requests exp283%
find_mock_file exp693%
start_capturing exp495%
.mockPaths exp3100%
block_requests exp1100%

People & History

People (3)
Maintainer (1)
Author, Maintainer
Authors (1)
Author, Maintainer
Contributors (2)
Contributor · added in 4.0.0
Contributor · added in 4.0.0
Package Timeline

20 releases. Pick two to compare their code metrics. R releases are shown for context.

  • R
    R 4.6.0 released · 2026-04-24
  • 4.2.3Latest
    2025-11-15 · current release · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 4.2.2
    2024-01-23 · diff ↗
  • 4.2.1
    2023-06-12 · diff ↗
  • 4.2.0
    2023-05-29 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • 4.1.0
    2021-09-22 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • 4.0.0
    2021-02-01 · diff ↗
  • R
    R 4.0.0 released · 2020-04-24
  • 3.3.0
    2020-01-28 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
  • 3.2.2
    2018-12-07 · diff ↗
Show 15 earlier events
  • 3.2.0
    2018-11-09 · diff ↗
  • 3.1.0
    2018-06-19 · diff ↗
  • R
    R 3.5.0 released · 2018-04-23
  • 3.0.0
    2018-01-16 · diff ↗
  • 2.3.4
    2017-11-14 · diff ↗
  • 2.3.2
    2017-10-20 · diff ↗
  • 2.1.2
    2017-08-05 · diff ↗
  • 2.1.0
    2017-07-31 · diff ↗
  • 2.0.0
    2017-06-05 · diff ↗
  • R
    R 3.4.0 released · 2017-04-21
  • 1.3.0
    2017-04-13 · diff ↗
  • 1.2.0
    2017-03-22 · diff ↗
  • 1.1.0
    2017-02-03 · diff ↗
  • 1.0.0
    2016-12-31
  • R
    R 3.3.0 released · 2016-05-03

Package metadata

First published
2016-12-31
Total releases
20 / 10 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 3.5.0
Download size
118 KB
Installed size
not tracked yet
With dependencies
not tracked yet
Appears in task views
Report a problem with this page →