r-lib / httr

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

httr::parse_url cannot handle a missing protocol #689

Closed colearendt closed 1 year ago

colearendt commented 3 years ago

Related to #659

It seems httr::parse_url has a dependency on protocol that is surprising. For instance, if protocol is not defined, then everything shows up in the $path, where I would expect the hostname to be parsed.

packageVersion("httr")
#> [1] '1.4.2'
httr::parse_url("myserver.com/path")
#> $scheme
#> NULL
#> 
#> $hostname
#> NULL
#> 
#> $port
#> NULL
#> 
#> $path
#> [1] "myserver.com/path"
#> 
#> $query
#> NULL
#> 
#> $params
#> NULL
#> 
#> $fragment
#> NULL
#> 
#> $username
#> NULL
#> 
#> $password
#> NULL
#> 
#> attr(,"class")
#> [1] "url"

Created on 2021-04-16 by the reprex package (v0.3.0)

hadley commented 1 year ago

httr has been superseded in favour of httr2, so is no longer under active development. If this problem is still important to you in httr2, I'd suggest filing an issue offer there 😄. Thanks for using httr!