webmockr-package: webmockr

webmockr-packageR Documentation

webmockr

Description

Stubbing and setting expectations on HTTP requests

Features

  • Stubbing HTTP requests at low http client lib level

  • Setting and verifying expectations on HTTP requests

  • Matching requests based on method, URI, headers and body

  • Supports multiple HTTP libraries, including crul and httr

  • Integration with HTTP test caching library vcr

Author(s)

Scott Chamberlain myrmecocystus+r@gmail.com

Aaron Wolen

Examples

library(webmockr)
stub_request("get", "https://httpbin.org/get")
stub_request("post", "https://httpbin.org/post")
stub_registry()

webmockr documentation built on March 7, 2023, 5:25 p.m.