Package: webmockr 2.0.0

Scott Chamberlain

webmockr: Stubbing and Setting Expectations on 'HTTP' Requests

Stubbing and setting expectations on 'HTTP' requests. Includes tools for stubbing 'HTTP' requests, including expected request conditions and response conditions. Match on 'HTTP' method, query parameters, request body, headers and more. Can be used for unit tests or outside of a testing context.

Authors:Scott Chamberlain [aut, cre], Aaron Wolen [ctb], rOpenSci [fnd]

webmockr_2.0.0.tar.gz
webmockr_2.0.0.zip(r-4.5)webmockr_2.0.0.zip(r-4.4)webmockr_2.0.0.zip(r-4.3)
webmockr_2.0.0.tgz(r-4.4-any)webmockr_2.0.0.tgz(r-4.3-any)
webmockr_2.0.0.tar.gz(r-4.5-noble)webmockr_2.0.0.tar.gz(r-4.4-noble)
webmockr_2.0.0.tgz(r-4.4-emscripten)webmockr_2.0.0.tgz(r-4.3-emscripten)
webmockr.pdf |webmockr.html
webmockr/json (API)
NEWS

# Install 'webmockr' in R:
install.packages('webmockr', repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/ropensci/webmockr/issues

Pkgdown:https://docs.ropensci.org

On CRAN:

httphttpsapiweb-servicescurlmockmockingfakewebhttp-mockingtestingtesting-toolstddhttp-mock

7.98 score 50 stars 1 packages 122 scripts 2.9k downloads 58 exports 14 dependencies

Last updated 6 days agofrom:ba664b3049 (on main). Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKDec 14 2024
R-4.5-winOKDec 14 2024
R-4.5-linuxOKDec 14 2024
R-4.4-winOKDec 14 2024
R-4.4-macOKDec 14 2024
R-4.3-winOKDec 14 2024
R-4.3-macOKDec 14 2024

Exports:%>%AdapterBodyPatternbuild_crul_requestbuild_crul_responsebuild_httr_requestbuild_httr_responsebuild_httr2_requestbuild_httr2_responseCrulAdapterdisableenableenabledexcludingHashCounterHeadersPatternHttpLibAdapaterRegistryhttr_mockhttr2_mockHttr2AdapterHttrAdapterincludinglast_requestlast_stubMethodPatternmock_filepluck_bodyremove_request_stubrequest_registryrequest_registry_clearRequestPatternRequestRegistryRequestSignatureResponsestub_body_diffstub_registrystub_registry_clearstub_requestStubbedRequestStubCounterStubRegistryto_raiseto_returnto_return_to_timeoutUriPatternwebmockr_allow_net_connectwebmockr_configurationwebmockr_configurewebmockr_configure_resetwebmockr_crul_fetchwebmockr_disablewebmockr_disable_net_connectwebmockr_enablewebmockr_net_connect_allowedwebmockr_resetwi_thwi_th_

Dependencies:clicrulcurlfauxpashttpcodejsonlitemagrittrmimeR6Rcpprlangtriebeardurltoolswhisker

Readme and manuals

Help Manual

Help pageTopics
Build a crul requestbuild_crul_request
Build a crul responsebuild_crul_response
Build a httr requestbuild_httr_request
Build a httr responsebuild_httr_response
Build an httr2 requestbuild_httr2_request
Build a httr2 response ('httr2_response')build_httr2_response
Adapters for Modifying HTTP RequestsAdapter CrulAdapter Httr2Adapter HttrAdapter
Enable or disable webmockrdisable enable enabled
HashCounterHashCounter
HttpLibAdapaterRegistryHttpLibAdapaterRegistry
Turn on 'httr' mockinghttr_mock
Turn on 'httr2' mockinghttr2_mock
Partially match request query parameters or request bodiesexcluding including partial
Get the last HTTP request madelast_request
Get the last stub createdlast_stub
Mock filemock_file
Mocking writing to diskmocking-disk-writing
Extract the body from an HTTP requestpluck_body
Remove a request stubremove_request_stub
List or clear requests in the request registryrequest_registry request_registry_clear
RequestPattern classRequestPattern
RequestRegistryRequestRegistry
RequestSignatureRequestSignature
ResponseResponse
Get a diff of a stub request body and a request body from an http requeststub_body_diff
List stubs in the stub registrystub_registry
stub_registry_clearstub_registry_clear
Stub an http requeststub_request
StubbedRequestStubbedRequest
StubCounterStubCounter
StubRegistryStubRegistry
Set raise error conditionto_raise
Expectation for what's returned from a stubbed requestto_return
Set timeout as an expected return on a matchto_timeout
webmockr configurationwebmockr_allow_net_connect webmockr_configuration webmockr_configure webmockr_configure_reset webmockr_disable_net_connect webmockr_net_connect_allowed
webmockr_resetwebmockr_reset
Defunct functions in 'webmockr'webmockr-defunct
Set additional parts of a stubbed requestwi_th