Skip to content

Commit

Permalink
Update utils_nba_stats.R
Browse files Browse the repository at this point in the history
  • Loading branch information
saiemgilani committed Mar 21, 2023
1 parent 64d5eba commit f891b79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utils_nba_stats.R
Expand Up @@ -66,14 +66,14 @@ request_with_proxy <- function(url,
)
if (length(params) >= 1) {
url <- httr::modify_url({{url}}, query = params)
res <- rvest::session(url = {{url}}, ..., httr::add_headers(.headers = headers), httr::timeout(10))
res <- rvest::session(url = {{url}}, ..., httr::add_headers(.headers = headers), httr::timeout(60))

json <- res$response %>%
httr::content(as = "text", encoding = "UTF-8") %>%
jsonlite::fromJSON()

} else {
res <- rvest::session(url = {{url}}, ..., httr::add_headers(.headers = headers), httr::timeout(10))
res <- rvest::session(url = {{url}}, ..., httr::add_headers(.headers = headers), httr::timeout(60))

json <- res$response %>%
httr::content(as = "text", encoding = "UTF-8") %>%
Expand Down

0 comments on commit f891b79

Please sign in to comment.