I'm trying to request data from an API but getting an error. Here's the full code:
library(tidyverse)
library(httr2)
req <- request("https://www.ec.europa.eu/agrifood/api/beef/prices?memberStateCodes=PT&years=2019,2020&months=1,3,9&weeks=5,6,7,8,40,41,42&beginDate=01/09/2019&endDate=02/02/2020&carcassCategories=heifers,cows")
resp <- req |> req_perform()
And the full response error:
Error in req_perform():
! Failed to perform HTTP request.
Caused by error in curl::curl_fetch_memory():
! OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0
Can anyone suggest a solution? Thanks!