From 1e45cc3631430e90f0a45a7c356ab07d05b38709 Mon Sep 17 00:00:00 2001 From: Tomas Okal Date: Sun, 19 Apr 2020 13:23:34 -0500 Subject: [PATCH] replace httr::GET() with httr::RETRY() --- R/lookup.R | 2 +- R/paginated.R | 2 +- R/search.R | 2 +- R/store_locator.R | 2 +- R/taxonomy.R | 2 +- R/trending.R | 2 +- R/vod.R | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/R/lookup.R b/R/lookup.R index 3a64a9e..2d753a5 100644 --- a/R/lookup.R +++ b/R/lookup.R @@ -53,7 +53,7 @@ lookup <- function(key = auth_cache$KEY, lsPublisherId = NULL, id = NULL, upc = url <- glue::glue("{url}&lsPublisherId={lsPublisherId}") } - response <- httr::GET(url) + response <- httr::RETRY(verb = "GET", url) if (httr::http_type(response) != "application/json") { stop("API did not return json", call. = FALSE) diff --git a/R/paginated.R b/R/paginated.R index b646d3e..29f5265 100644 --- a/R/paginated.R +++ b/R/paginated.R @@ -57,7 +57,7 @@ paginted <- function(key = auth_cache$KEY, lsPublisherId = NULL, url <- glue::glue("{url}&lsPublisherId={lsPublisherId}") } - response <- httr::GET(url) + response <- httr::RETRY(verb = "GET", url) if (httr::http_type(response) != "application/json") { stop("API did not return json", call. = FALSE) diff --git a/R/search.R b/R/search.R index e63520b..2006a24 100644 --- a/R/search.R +++ b/R/search.R @@ -94,7 +94,7 @@ searching <- function(query, key = auth_cache$KEY, lsPublisherId = NULL, url <- glue::glue("{url}&lsPublisherId={lsPublisherId}") } - response <- httr::GET(url) + response <- httr::RETRY(verb = "GET", url) if (httr::http_type(response) != "application/json") { stop("API did not return json", call. = FALSE) diff --git a/R/store_locator.R b/R/store_locator.R index 7d7bf36..7e13592 100644 --- a/R/store_locator.R +++ b/R/store_locator.R @@ -51,7 +51,7 @@ store_locator <- function(key = auth_cache$KEY, lat = NULL, lon = NULL, url <- glue::glue("{base_url}&lon={lon}&lat={lat}") } - response <- httr::GET(url) + response <- httr::RETRY(verb = "GET", url) if (httr::http_type(response) != "application/json") { stop("API did not return json", call. = FALSE) diff --git a/R/taxonomy.R b/R/taxonomy.R index 81ea2c3..bfa27b1 100644 --- a/R/taxonomy.R +++ b/R/taxonomy.R @@ -31,7 +31,7 @@ taxonomy <- function(key = auth_cache$KEY, list_output = FALSE) { url <- glue::glue("http://api.walmartlabs.com/v1/taxonomy?apiKey={key}") - response <- httr::GET(url) + response <- httr::RETRY(verb = "GET", url) if (httr::http_type(response) != "application/json") { stop("API did not return json", call. = FALSE) diff --git a/R/trending.R b/R/trending.R index dc81a83..1073784 100644 --- a/R/trending.R +++ b/R/trending.R @@ -37,7 +37,7 @@ trending <- function(key = auth_cache$KEY, lsPublisherId = NULL, url <- glue::glue("{url}&lsPublisherId={lsPublisherId}") } - response <- httr::GET(url) + response <- httr::RETRY(verb = "GET", url) if (httr::http_type(response) != "application/json") { stop("API did not return json", call. = FALSE) diff --git a/R/vod.R b/R/vod.R index 433fb84..7ca3862 100644 --- a/R/vod.R +++ b/R/vod.R @@ -27,7 +27,7 @@ VOD <- function(key = auth_cache$KEY, list_output = FALSE) { url <- glue::glue("http://api.walmartlabs.com/v1/vod?format=json&apiKey={key}") - response <- httr::GET(url) + response <- httr::RETRY(verb = "GET", url) if (httr::http_type(response) != "application/json") { stop("API did not return json", call. = FALSE)