This is the constructor function for the httr2_response S3 class. It is
useful primarily for mocking.
new_response(
method,
url,
status_code,
headers,
body,
timing = NULL,
request = NULL,
error_call = caller_env()
)HTTP method used to retrieve the response.
URL response came from; might not be the same as the URL in the request if there were any redirects.
HTTP status code. Must be a single integer.
HTTP headers. Can be supplied as a raw or character vector which will be parsed using the standard rules, or a named list.
The body of the response. Can be a raw vector, a <httr2_path>,
or a StreamingBody.
A named numeric vector giving the time taken by various components.
The request used to generate this response.
Environment (on call stack) used in error messages.
An HTTP response: an S3 list with class httr2_response.