testing
#> <webmockr stub>
#> method: get
#> uri: https://httpbin.org/get
#> with:
#> query:
#> body:
#> request_headers:
#> to_return:
#> - status: 200
#> body: success!
#> response_headers:
#> should_timeout: FALSE
#> should_raise: FALSE
#> <webmockr stub registry>
#> Registered Stubs
#> GET: https://httpbin.org/get | to_return: with body "success!" with status 200
# make the request
z <- crul::HttpClient$new(url = "https://httpbin.org")$get("get")
# run tests (nothing returned means it passed)
expect_is(z, "HttpResponse")
expect_equal(z$status_code, 200)
expect_equal(z$parse("UTF-8"), "success!")