Skip to content

httptest

A Test Environment for HTTP Requests

v4.2.3 · Nov 15, 2025 · MIT + file LICENSE

Description

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.

Downloads

CRAN

5.1K

Last 30 days

1692nd

13.9K

Last 90 days

50.1K

Last year

Trend: -7.3% (30d vs prior 30d)

r2u CRAN

16

Last 30 days

44

Last 90 days

190

Last year

Trend: -11.1% (30d vs prior 30d)

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 9, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 8, 2026
ERROR r-devel-linux-x86_64-debian-gcc

tests

Running ‘spelling.R’ [0s/0s]
  Running ‘testthat.R’ [8s/10s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > test_check("httptest")
  Loading required package: httptest
  Saving _problems/test-find-redactor-
...[truncated]...
──
  Error in `detach("package:testpkg", unload = TRUE)`: invalid 'name' argument
  Backtrace:
      ▆
   1. └─base::detach("package:testpkg", unload = TRUE)
  
  [ FAIL 3 | WARN 0 | SKIP 13 | PASS 285 ]
  Error:
  ! Test failures.
  Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Reverse Dependencies (55)

imports

Dependency Network

Dependencies Reverse dependencies testthat curl digest httr jsonlite speechbr ProPublicaR SC2API academictwitteR aiRly alfr bambooHR bitmexr briqr ccdR codewhere colourlovers cometr connectapi covidcast +40 more reverse deps httptest

Version History

21 tracked
new 4.2.3 Mar 10, 2026
updated 4.2.3 ← 4.2.2 diff Nov 14, 2025
updated 4.2.2 ← 4.2.1 diff Jan 22, 2024
updated 4.2.1 ← 4.2.0 diff Jun 11, 2023
updated 4.2.0 ← 4.1.0 diff May 28, 2023
updated 4.1.0 ← 4.0.0 diff Sep 21, 2021
updated 4.0.0 ← 3.3.0 diff Jan 31, 2021
updated 3.3.0 ← 3.2.2 diff Jan 27, 2020
updated 3.2.2 ← 3.2.0 diff Dec 6, 2018
updated 3.2.0 ← 3.1.0 diff Nov 8, 2018
updated 3.1.0 ← 3.0.0 diff Jun 18, 2018
updated 3.0.0 ← 2.3.4 diff Jan 15, 2018
updated 2.3.4 ← 2.3.2 diff Nov 13, 2017
updated 2.3.2 ← 2.1.2 diff Oct 19, 2017
updated 2.1.2 ← 2.1.0 diff Aug 4, 2017