I'm trying to do a GET
call to pull an inventory of numbers for a particular account from a website. However, when doing this call in R, I keep getting an error. See below:
url <- "https://examplewebsite.com/api/account/inventory"
response <-
GET(url = url)
Response:
Error in curl::curl_fetch_memory(url, handle = handle) :
Failure when receiving data from the peer
I am able to get the requested data through postman, so this appears to be an R/HTTR related issue. It was suggested to me that perhaps the request was timing out, but I added the timeout
argument, without relief.
Additionally, the default max return on inventory numbers is 300. When I have tried to pull from an account with under 50 numbers, it works. However, if an account has an inventory that is at the max of 300, I get the above error message.
Any thoughts are appreciated. Thanks!