Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow relative urls when parsing #610

Merged
merged 2 commits into from
Dec 24, 2024
Merged

Allow relative urls when parsing #610

merged 2 commits into from
Dec 24, 2024

Conversation

hadley
Copy link
Member

@hadley hadley commented Dec 23, 2024

Fixes #449

@hadley
Copy link
Member Author

hadley commented Dec 23, 2024

Should also add:

#' # Use a relative url
#' req <- request("http://example.com/a/b/c")
#' req |> req_url_relative("..")


#' @export
#' @rdname req_url
req_url_relative <- function(req, url) {
  check_request(req)

  new_url <- url_parse(url, base_url = req$url)
  req_url(req, url_build(url))
}

@hadley hadley merged commit e58e86c into main Dec 24, 2024
13 checks passed
@hadley hadley deleted the relative-urls branch December 24, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need absolute URL helper
1 participant