Skip to content

Commit

Permalink
Convert application/xml to text before parsing.
Browse files Browse the repository at this point in the history
Closes #160
  • Loading branch information
hadley committed Oct 17, 2014
1 parent ace6036 commit 7ed5bc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@

* Default "Accepts" header set to
`application/json, text/xml, application/xml, */*`: this should slightly
increase the likelihood of getting xml back.
increase the likelihood of getting xml back. `application/xml` is correctly
converted to text before being parsed to `XML::xmlParse()` (#160).

* Make it again possible to override the content type set up by `POST()`
when sending data (#140).
Expand Down
2 changes: 1 addition & 1 deletion R/content-parse.r
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ parsers$`application/x-www-form-urlencoded` <- function(x) {
}
parsers$`application/xml` <- function(x, ...) {
need_package("XML")
XML::xmlParse(x, ...)
XML::xmlParse(parse_text(x, encoding = "UTF-8"), ...)
}

# Text formats -----------------------------------------------------------------
Expand Down

0 comments on commit 7ed5bc1

Please sign in to comment.