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

3.3K

Last 30 days

2245th

8.9K

Last 90 days

42.3K

Last year

Trend: +24.7% (30d vs prior 30d)

CRAN Check Status

14 OK
Show all 14 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-macos-arm64 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 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Reverse Dependencies (53)

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 +38 more reverse deps httptest

Version History

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
updated 2.1.0 ← 2.0.0 diff Jul 30, 2017
updated 2.0.0 ← 1.3.0 diff Jun 4, 2017
updated 1.3.0 ← 1.2.0 diff Apr 12, 2017
updated 1.2.0 ← 1.1.0 diff Mar 21, 2017
updated 1.1.0 ← 1.0.0 diff Feb 2, 2017