Commit 53476076 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Merge pull request #183 from ldecicco-USGS/master

encoding message.
parents 65e66a60 cf51e011
Package: dataRetrieval
Type: Package
Title: Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data
Version: 2.5.0
Date: 2016-02-24
Version: 2.5.1
Date: 2016-02-26
Authors@R: c( person("Robert", "Hirsch", role = c("aut"),
email = "rhirsch@usgs.gov"),
person("Laura", "DeCicco", role = c("aut","cre"),
......@@ -35,7 +35,7 @@ Imports:
stats,
utils,
dplyr,
readr
readr (>= 0.1.1.9000)
Suggests:
xtable,
knitr,
......
......@@ -34,20 +34,18 @@ getWebServiceData <- function(obs_url, ...){
} else {
headerInfo <- headers(returnedList)
if(headerInfo$`content-type` == "text/tab-separated-values;charset=UTF-8"){
returnedDoc <- content(returnedList, type="text",encoding = "UTF-8")
} else if (headerInfo$`content-type` == "text/xml;charset=UTF-8"){
returnedDoc <- xmlcontent(returnedList)
} else {
returnedDoc <- content(returnedList)
returnedDoc <- content(returnedList,encoding = "UTF-8")
if(grepl("No sites/data found using the selection criteria specified", returnedDoc)){
message(returnedDoc)
}
}
attr(returnedDoc, "headerInfo") <- headerInfo
return(returnedDoc)
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/getWebServiceData.R
\name{xmlcontent}
\alias{xmlcontent}
\title{drop in replacement for httr switching to xml2 from XML}
\usage{
xmlcontent(response)
}
\arguments{
\item{response}{the result of httr::GET(url)}
}
\description{
reverts to old parsing pre v1.1.0 for httr
}
\keyword{internal}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment