Gitlab is now using https://gitlab.lcsb.uni.lu as it's primary address. Please update your bookmarks. FAQ.

Commit d9709d11 authored by Marek Ostaszewski's avatar Marek Ostaszewski
Browse files

helper functions update

parent 8e8b1d48
Pipeline #37202 passed with stages
in 4 minutes and 4 seconds
......@@ -9,14 +9,14 @@ library(httr)
library(jsonlite)
### A convenience function to handle API queries
ask_GET <- function(fask_url, verbose = F) {
ask_GET <- function(fask_url, verbose = F, encoding = "UTF-8") {
if(verbose) {
message(URLencode(fask_url))
}
resp <- httr::GET(url = URLencode(fask_url),
httr::add_headers('Content-Type' = "application/x-www-form-urlencoded"))
if(httr::status_code(resp) == 200) {
return(httr::content(resp, as = "text"))
return(httr::content(resp, as = "text", encoding = encoding))
}
return(NULL)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment