Commit 8fb3bed8 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Lets content be tab or csv

parent 37435642
...@@ -47,7 +47,8 @@ getWebServiceData <- function(obs_url, ...){ ...@@ -47,7 +47,8 @@ getWebServiceData <- function(obs_url, ...){
return(invisible(NULL)) return(invisible(NULL))
} }
if(headerInfo$`content-type` %in% c("text/tab-separated-values;charset=UTF-8")){ if(headerInfo$`content-type` %in% c("text/tab-separated-values;charset=UTF-8",
"text/csv;charset=UTF-8")){
returnedDoc <- httr::content(returnedList, type="text",encoding = "UTF-8") returnedDoc <- httr::content(returnedList, type="text",encoding = "UTF-8")
} else if (headerInfo$`content-type` %in% } else if (headerInfo$`content-type` %in%
c("application/zip", c("application/zip",
...@@ -61,7 +62,7 @@ getWebServiceData <- function(obs_url, ...){ ...@@ -61,7 +62,7 @@ getWebServiceData <- function(obs_url, ...){
return(txt) return(txt)
} else { } else {
returnedDoc <- httr::content(returnedList,encoding = "UTF-8") returnedDoc <- httr::content(returnedList,encoding = "UTF-8")
if(grepl("No sites/data found using the selection criteria specified", returnedDoc)){ if(all(grepl("No sites/data found using the selection criteria specified", returnedDoc))){
message(returnedDoc) message(returnedDoc)
} }
if(headerInfo$`content-type` == "text/xml"){ if(headerInfo$`content-type` == "text/xml"){
......
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