header_tag.html

Skip to contents

This function accepts a url parameter, and returns the raw data.

Usage

getWebServiceData(obs_url, ...)

Arguments

obs_url

character containing the url for the retrieval

...

information to pass to header request

Value

Returns xml, json, or text depending on the requested data.

Details

To add a custom user agent, create an environmental variable: CUSTOM_DR_UA

Examples

siteNumber <- "02177000"
startDate <- "2012-09-01"
endDate <- "2012-10-01"
offering <- "00003"
property <- "00060"
obs_url <- constructNWISURL(siteNumber, property, startDate, endDate, "dv")
# \donttest{
rawData <- getWebServiceData(obs_url)
#> GET:https://waterservices.usgs.gov/nwis/dv/?site=02177000&format=waterml%2C1.1&ParameterCd=00060&StatCd=00003&startDT=2012-09-01&endDT=2012-10-01
# }