add tests for exec and getConnection methods in HttpRequest class
[arvados.git] / sdk / R / R / RESTService.R
index 7048b159cc8099180c6f5c689cc8b51a5327c5b3..108aa1969f3b8754893ba0c565e17491ddd5b546 100644 (file)
@@ -186,21 +186,13 @@ RESTService <- R6::R6Class(
             self$httpParser$parseResponse(serverResponse, "text")
         },
 
-        getConnection = function(uuid, relativePath, openMode)
+        getConnection = function(relativePath, uuid, openMode)
         {
             fileURL <- paste0(self$getWebDavHostName(), 
                               "c=", uuid, "/", relativePath);
             headers <- list(Authorization = paste("OAuth2", self$token))
 
-            h <- curl::new_handle()
-            curl::handle_setheaders(h, .list = headers)
-
-            if(toString(Sys.getenv("ARVADOS_API_HOST_INSECURE") == "TRUE"))
-               curl::handle_setopt(h, ssl_verifypeer = 0L)
-
-            conn <- curl::curl(url = fileURL, open = openMode, handle = h)
-
-            conn
+            conn <- self$http$getConnection(fileURL, headers, openMode)
         }
     ),