Skip to contents

Title

Usage

resp_tidy_json(resp, spec = NULL, unspecified = "list", subset_path = NULL)

Arguments

resp

(httr2_response) A single httr2::response() object (as returned by httr2::req_perform()).

spec

(tspec or NULL) A specification used by tibblify::tibblify() to parse the extracted body of resp. When spec is NULL (the default), tibblify::tibblify() will attempt to guess a spec.

unspecified

(length-1 character) A string that describes what happens if the extracted body of resp contains fields that are not specified in spec. While tibblify::tibblify() defaults to NULL for this value, we set it to list so that the body will still parse when resp contains extra data without throwing errors.

subset_path

(character) An optional vector indicating the path to the "real" object within the body of resp. For example, many APIs return a body with information about the status of the response, cache information, perhaps pagination information, and then the actual data in a field such as data. If the desired part of the response body is in data$objects, the value of this argument should be c("data", "object").

Value

The tibblified response body.