tests/testthat/_snaps/req-body.md

errors if file doesn't exist

Code
  req_body_file(request_test(), "doesntexist", type = "text/plain")
Condition
  Error in `req_body_file()`:
  ! `path` ('doesntexist') does not exist.

non-json type errors

Code
  req_body_json(request_test(), mtcars, type = "application/xml")
Condition
  Error in `req_body_json()`:
  ! Unexpected content type "application/xml".
  * Expecting type "application/json" or suffix "json".


Try the httr2 package in your browser

Any scripts or data that you put into this service are public.

httr2 documentation built on Nov. 14, 2023, 5:08 p.m.