r-lib / httr

httr: a friendly http package for R
https://httr.r-lib.org
Other
986 stars 1.99k forks source link

Add mime type qs::qread() to httr::content() #727

Closed tsenegas closed 10 months ago

tsenegas commented 1 year ago

Is there an easy way to add the mime type qs::qread() to the httr::content() function ?

Let's say by adding to content-parse.R something like this:

parsers$`application/octet-stream` <- function(x, encoding = NULL, type = NULL, ...) {
    need_package("qs")
    qs::qread(x)
}

Thanks

hadley commented 10 months ago

httr has been superseded in favour of httr2, so is no longer under active development. httr2 uses a different parsing mechanism with less built in magic, so this wouldn't be needed in httr2.