| new_response | R Documentation |
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()
)
method |
HTTP method used to retrieve the response. |
url |
URL response came from; might not be the same as the URL in the request if there were any redirects. |
status_code |
HTTP status code. Must be a single integer. |
headers |
HTTP headers. Can be supplied as a raw or character vector which will be parsed using the standard rules, or a named list. |
body |
The body of the response. Can be a raw vector, a |
timing |
A named numeric vector giving the time taken by various components. |
request |
The request used to generate this response. |
error_call |
Environment (on call stack) used in error messages. |
An HTTP response: an S3 list with class httr2_response.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.