Skip to content

Commit

Permalink
Merge pull request #167 from GlobalFishingWatch/develop
Browse files Browse the repository at this point in the history
add missing agent calls
  • Loading branch information
AndreaSanchezTapia committed Jul 19, 2024
2 parents 73a4a5c + e43e299 commit 0a6e9d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/get_event.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions R/get_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(.)

Expand Down

0 comments on commit 0a6e9d0

Please sign in to comment.