Learn R Programming

webmockr (version 0.1.0)

webmockr-package: Stubbing and setting expectations on HTTP requests

Description

Stubbing and setting expectations on HTTP requests

Arguments

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
  • Can support many HTTP libraries, though only crul for now
  • Integration with testing libraries (coming soon) via vcr

Examples

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

Run the code above in your browser using DataLab