save_response: Write out a captured response

View source: R/capture-requests.R

save_responseR Documentation

Write out a captured response

Description

Write out a captured response

Usage

save_response(response, file, simplify = TRUE)

Arguments

response

An httr2_response object

file

String file path to write to

simplify

logical: if TRUE (default), JSON responses with status 200 and a supported Content-Type will be written as just the text of the response body. In all other cases, and when simplify is FALSE, the httr2_response object will be written out to a .R file using base::dput().

Value

The character file name that was written out


httptest2 documentation built on May 29, 2024, 8:42 a.m.