I am new to Groovy development and working to pull data from an api that only supports a content-type of geo+json. My code parses that headers but not the data. Any suggestions on to get the map created?
def str_uri = [
uri: "https://api.weather.gov/alerts/active/zone/${settings.noaa_zone}",
headers: [
"user-agent": "My Hubitat Driver (email_address)"
]
try {
httpGet(str_uri) { str_uri_resp ->
str_uri_resp.headers.each {
log.debug "Response Header: ${it.name} : ${it.value}"
}
if (log_all_noaa == true) {
log.debug "response contentType: ${str_uri_resp.contentType}"
log.debug "response data: ${str_uri_resp.data}"
}
if (log_all_noaa == false) {
log.info "NOAA Alert detailed logging disabled"
}
}
} catch (e) {
log.error "NOAA _Alert ERROR: $e"
}