Wave1art / wekeoR

Library for interacting with ESA Copernicus and Sentinel data via the WEkEO API. Simplifies the task of downloading Copernicus and Sentinel datasets provided by the European Union.
Other
1 stars 0 forks source link

add_headers #1

Open MatMatt opened 2 years ago

MatMatt commented 2 years ago

Hi,

I am trying out your example but I am running into the following issue:

`

sessionInfo() R version 4.2.1 (2022-06-23 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19043) Matrix products: default locale: [1] LC_COLLATE=English_United Kingdom.utf8 LC_CTYPE=English_United Kingdom.utf8 LC_MONETARY=English_United Kingdom.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.utf8
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] wekeoR_0.1.0 loaded via a namespace (and not attached): [1] rstudioapi_0.13 magrittr_2.0.3 usethis_2.1.6 devtools_2.4.3 pkgload_1.2.4 R6_2.5.1 rlang_1.0.2 fastmap_1.1.0 httr_1.4.3
[10] tools_4.2.1 pkgbuild_1.3.1 sessioninfo_1.2.2 cli_3.3.0 withr_2.5.0 ellipsis_0.3.2 remotes_2.4.2 rprojroot_2.0.3 lifecycle_1.0.1
[19] crayon_1.5.1 brio_1.1.3 processx_3.6.1 purrr_0.3.4 callr_3.7.0 fs_1.5.2 ps_1.7.1 curl_4.3.2 testthat_3.1.4
[28] memoise_2.0.1 glue_1.6.2 cachem_1.0.6 compiler_4.2.1 desc_1.4.1 prettyunits_1.1.1

hda_list = wekeoR::init(....

hda_list = hda_list |> get_access_token() |> acceptTandC() |> submit_wekeo_query(query) |> get_query_results_list() Getting access token. This token is valid for one hour only. Error in add_headers(.headers = unlist(headers)) : could not find function "add_headers"

traceback() 14: as.request(config) 13: request_build("GET", hu$url, as.request(config), ...) 12: httr::GET(hda_list$accessToken_address, add_headers(.headers = unlist(headers))) 11: get_access_token(hda_list) 10: handle_url(handle, url, ...) 9: httr::GET(hda_list$acceptTandC_address, add_headers(.headers = unlist(hda_list$headers))) 8: acceptTandC(get_access_token(hda_list)) 7: handle_url(handle, url, ...) 6: httr::POST(hda_list$dataRequest_address, add_headers(.headers = unlist(hda_list$headers)), body = query, encode = "json") 5: submit_wekeo_query(acceptTandC(get_access_token(hda_list)), query) 4: paste(hda_list$dataRequest_address, "/jobs/", hda_list$job_id, "/result", sep = "") 3: handle_url(handle, url, ...) 2: httr::GET(paste(hda_list$dataRequest_address, "/jobs/", hda_list$job_id, "/result", sep = ""), add_headers(.headers = unlist(hda_list$headers)), query = list(page = page)) 1: get_query_results_list(submit_wekeo_query(acceptTandC(get_access_token(hda_list)), query)) `

Thanks!

korandocando commented 1 year ago

Hi all! I'm trying the example query too, and I get the same error (and same traceback) as @MatMatt.