Apparently httr2::request() objects are themselves lists, so how does one create a list of requests for use with httr2::req_perform_parallel() and httr2::req_perform_sequential() since R does not allow storing list objects inside of a list yet both of these functions require an input of a list of requests.
library(httr2)
library(magrittr)
request_list <- vector(mode = "list", length = 3)
request_list[1] <- "http://www.someapi.com/API?x=test" %>% request()
#> Warning in request_list[1] <- "http://www.someapi.com/API?x=test" %>%
#> request(): number of items to replace is not a multiple of replacement length
request_list[2] <- "http://www.someapi.com/API?x=confused" %>% request()
#> Warning in request_list[2] <- "http://www.someapi.com/API?x=confused" %>% :
#> number of items to replace is not a multiple of replacement length
request_list[3] <- "http://www.someapi.com/API?x=example" %>% request()
#> Warning in request_list[3] <- "http://www.someapi.com/API?x=example" %>% :
#> number of items to replace is not a multiple of replacement length
Why can't I assign a request to a list in the manor that I have tried above? What is the reason that I receive this error. I think if I understand the problem here then I will have a better understanding of how lists work.