Browse code

Invert JSON retrievel to GET strategy. Seems to be working better.

Tiago Silva authored on 10/03/2023 19:51:03
Showing 1 changed files

... ...
@@ -288,11 +288,11 @@ GDCquery <- function(
288 288
                 sample.type = sample.type
289 289
             )
290 290
             json  <- tryCatch(
291
-                getURL(url,fromJSON,timeout(600),simplifyDataFrame = TRUE),
291
+                fromJSON(content(getURL(url,GET,timeout(600)), as = "text", encoding = "UTF-8"), simplifyDataFrame = TRUE),
292 292
                 error = function(e) {
293 293
                     message(paste("Error: ", e, sep = " "))
294 294
                     message("We will retry to access GDC!")
295
-                    fromJSON(content(getURL(url,GET,timeout(600)), as = "text", encoding = "UTF-8"), simplifyDataFrame = TRUE)
295
+                    getURL(url,fromJSON,timeout(600),simplifyDataFrame = TRUE)
296 296
                 }
297 297
             )
298 298
         }