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

Integrate features from rvest::read_xml.response #255

Closed
hadley opened this issue May 15, 2019 · 0 comments
Closed

Integrate features from rvest::read_xml.response #255

hadley opened this issue May 15, 2019 · 0 comments

Comments

@hadley
Copy link
Member

@hadley hadley commented May 15, 2019

read_xml.response <- function(x, ..., encoding = "", as_html = FALSE) {
  httr::stop_for_status(x)
  encoding <- encoding %||% default_encoding(x)

  xml2::read_xml(httr::content(x, "raw"), encoding = encoding, base_url = x$url,
    as_html = as_html)
}

i.e. check that the request succeeded, and pass the url along to base_url

@jimhester jimhester closed this in a160334 Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.