CRAN/E | httptest

httptest

A Test Environment for HTTP Requests

Installation

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.

enpiar.com/r/httptest/
github.com/nealrichardson/httptest
Bug report File report

Key Metrics

Version 4.2.2
R ≥ 3.5.0
Published 2024-01-23 91 days ago
Needs compilation? no
License MIT
License File
CRAN checks httptest results
Language en-US

Downloads

Yesterday 18 0%
Last 7 days 230 +1%
Last 30 days 1.172 -39%
Last 90 days 5.290 -7%
Last 365 days 23.063 +23%

Maintainer

Maintainer

Neal Richardson

neal.p.richardson@gmail.com

Authors

Neal Richardson

aut / cre

Jonathan Keane

ctb

Maëlle Salmon

ctb

Material

README
NEWS
Reference manual
Package source

In Views

WebTechnologies

Vignettes

Frequently Asked Questions
httptest: A Test Environment for HTTP Requests in R
Redacting and Modifying Recorded Requests
Writing Vignettes with APIs

macOS

r-release

arm64

r-oldrel

arm64

r-release

x86_64

Windows

r-devel

x86_64

r-release

x86_64

r-oldrel

x86_64

Old Sources

httptest archive

Depends

R ≥ 3.5.0
testthat

Imports

curl
digest
httr
jsonlite
stats
utils

Suggests

knitr
pkgload
rmarkdown
spelling
xml2

Reverse Imports

crplyr
speechbr

Reverse Suggests

academictwitteR
aiRly
alfr
bambooHR
bitmexr
briqr
cloudos
colourlovers
cometr
covidcast
crunch
crunchy
dkanr
DNH4
echor
edgarWebR
eph
EpiTxDb
f1dataR
ffscrapr
foundry
geofi
gwasrapidd
hackeRnews
httpcache
influxdbclient
lacrmr
metabolomicsWorkbenchR
mstrio
nhdplusTools
noaaoceans
npi
ohsome
openmeteo
osdatahub
oysteR
pivotaltrackR
pocketapi
portalr
promr
ProPublicaR
ramlegacy
rnassqs
rnbp
SC2API
scryr
sentryR
spectator
sship
tidygeoRSS
Load all 54 items
(warning: might lead to performance issues and take some time)