r-lib / httr

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

Vectorise functions #730

Closed multimeric closed 1 year ago

multimeric commented 1 year ago

It's a good practise for R functions to be vectorised, in particular because it reduces the need for loops etc when dealing with vectors or data frames of data. This also lets it better integrate with dplyr verbs.

As far as I can tell, none of the httr functions are vectorised:

httr::GET(c("https://github.com/r-lib/httr/archive/refs/tags/v1.4.4.tar.gz",
    "https://github.com/r-lib/httr/archive/refs/tags/v1.4.4.zip"))
#> Error in parse_url(url): length(url) == 1 is not TRUE

Created on 2022-12-22 with reprex v2.0.2

jennybc commented 1 year ago

I believe this is by design. In any case, httr is "maintenance mode" and its basic shape and surface is unlikely to change, given that active development has moved to httr2.