diff --git a/DESCRIPTION b/DESCRIPTION index b9d285191..1e1027ed7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -90,7 +90,7 @@ Suggests: gdalcubes (>= 0.7.0), geojsonsf, ggplot2, - httr2, + httr2 (>= 1.1.0), jsonlite, kohonen (>= 3.0.11), methods, diff --git a/R/api_cube.R b/R/api_cube.R index 2a4553717..f62944da6 100644 --- a/R/api_cube.R +++ b/R/api_cube.R @@ -1467,7 +1467,7 @@ NULL # check that token is valid .check_that(.has(res_content)) # parse token - token_parsed <- .url_parse(paste0("?", res_content[["token"]])) + token_parsed <- .url_parse_query(res_content[["token"]]) file_info[["path"]] <- purrr::map_chr(seq_along(fi_paths), function(i) { path <- fi_paths[[i]] if (are_local_paths[[i]]) { diff --git a/R/api_request_httr2.R b/R/api_request_httr2.R index 4339aaf1d..08b011d24 100644 --- a/R/api_request_httr2.R +++ b/R/api_request_httr2.R @@ -223,6 +223,19 @@ httr2::url_parse(url) } +#' @title Parse URL +#' @name .url_parse_query +#' @keywords internal +#' @noRd +#' @author Felipe Carvalho, \email{felipe.carvalho@@inpe.br} +#' +#' @param url A character with URL query string. +#' +#' @return An character vector with parsed URL query string. +.url_parse_query <- function(url) { + httr2::url_parse(url) +} + #' @title Build an URL #' @name .url_build #' @keywords internal