diff --git a/R/get_event.R b/R/get_event.R index 5f09f82..02c7e7d 100644 --- a/R/get_event.R +++ b/R/get_event.R @@ -272,7 +272,8 @@ get_event <- function(event_type, endpoint <- base %>% httr2::req_url_path_append('events') %>% httr2::req_url_query(!!!url_args) %>% - httr2::req_body_raw(., body = body_args) + httr2::req_body_raw(., body = body_args) %>% + httr2::req_user_agent(gfw_user_agent()) if (print_request) print(endpoint) # API call; will paginate if necessary, otherwise return list with one response @@ -532,7 +533,8 @@ get_event_stats <- function(event_type, endpoint <- base %>% httr2::req_url_path_append('events/stats') %>% - httr2::req_body_raw(body = body_args) + httr2::req_body_raw(body = body_args) %>% + httr2::req_user_agent(gfw_user_agent()) if (print_request) print(endpoint) # API call; will paginate if necessary, otherwise return list with one response diff --git a/R/get_raster.R b/R/get_raster.R index dcc4a74..c3e17ef 100644 --- a/R/get_raster.R +++ b/R/get_raster.R @@ -112,6 +112,7 @@ if (is.null(region_source)) stop("region_source and region params are required") #httr2::req_error(req = ., body = parse_response_error) if (print_request) print(request) response <- request %>% + httr2::req_user_agent(gfw_user_agent()) %>% httr2::req_perform(.) %>% httr2::resp_body_raw(.)