This function gets tab-delimited data from an httr2_response
and either saves it to a file or parses it into a data.frame
in memory.
Arguments
- resp
httr2_response
object, generated by e.g.httr2::req_perform()
orfetch_stream()
/fetch_paged()
.- page
integer
(optional), response page number. Ifpage
> 1 then the table header is removed before saving to file. Only used whencon
is specified.- con
string
or base::connection object (optional), the file in which to save the data.- encoding
string
(optional), character encoding of the body text. If not specified, will use the encoding specified by the content-type, falling back to"UTF8"
with a warning if it cannot be found. The resulting string is always re-encoded to UTF-8.