From e9d1d34e851eeb56ad319e18218a72c46eb7fe9d Mon Sep 17 00:00:00 2001 From: Tony Fujs Date: Tue, 2 Feb 2021 15:27:02 +0100 Subject: [PATCH] Make sure all URLs start with https: instead of http: --- R/connect_mdlib.R | 6 +++--- R/get_public_survey_list.R | 2 +- R/get_survey_list.R | 2 +- man/connect_mdlib.Rd | 4 ++-- vignettes/getting_started.Rmd | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/R/connect_mdlib.R b/R/connect_mdlib.R index 26bf29f..0612a1d 100644 --- a/R/connect_mdlib.R +++ b/R/connect_mdlib.R @@ -2,7 +2,7 @@ #' #' @param path character: path to send request #' @param query character -#' @param token character: access token to be obtained from \url{http://microdatalib.worldbank.org/index.php/auth/api_keys} +#' @param token character: access token to be obtained from \url{https://microdatalib.worldbank.org/index.php/auth/api_keys} #' @param root character: the root url that hosts the API #' #' @return object of class mdlib_api @@ -10,7 +10,7 @@ #' @importFrom utils str #' -connect_mdlib <- function(path, query = NULL, token, root = "http://microdatalib.worldbank.org") { +connect_mdlib <- function(path, query = NULL, token, root = "https://microdatalib.worldbank.org") { # Build request URL url <- httr::modify_url(root, path = path, query = query) # Send request to API @@ -43,7 +43,7 @@ connect_mdlib <- function(path, query = NULL, token, root = "http://microdatalib print.mdlib_api <- function(x, ...) { - cat("\n", sep = "") + cat("\n", sep = "") str(x$content) invisible(x) } diff --git a/R/get_public_survey_list.R b/R/get_public_survey_list.R index 9eca6ad..e6f92f6 100644 --- a/R/get_public_survey_list.R +++ b/R/get_public_survey_list.R @@ -9,7 +9,7 @@ get_public_survey_list <- function(token){ out <- connect_mdlib(path = 'index.php/api/catalog/search?ps=10000', token = token, - root = 'http://microdata.worldbank.org/') + root = 'https://microdata.worldbank.org/') out <- out$content$result$rows return(out) diff --git a/R/get_survey_list.R b/R/get_survey_list.R index 6feef53..132cf6a 100644 --- a/R/get_survey_list.R +++ b/R/get_survey_list.R @@ -18,7 +18,7 @@ get_survey_list <- function(token){ get_number_of_surveys <- function(token) { # Should be better integrated with the other functions (URL should not be hard coded) - url <- "http://microdatalib.worldbank.org/index.php/api/catalog/search?ps=1" + url <- "https://microdatalib.worldbank.org/index.php/api/catalog/search?ps=1" resp <- httr::GET(url, httr::add_headers(.headers = c('X-API-KEY' = token, diff --git a/man/connect_mdlib.Rd b/man/connect_mdlib.Rd index fd869c4..e04db28 100644 --- a/man/connect_mdlib.Rd +++ b/man/connect_mdlib.Rd @@ -8,7 +8,7 @@ connect_mdlib( path, query = NULL, token, - root = "http://microdatalib.worldbank.org" + root = "https://microdatalib.worldbank.org" ) } \arguments{ @@ -16,7 +16,7 @@ connect_mdlib( \item{query}{character} -\item{token}{character: access token to be obtained from \url{http://microdatalib.worldbank.org/index.php/auth/api_keys}} +\item{token}{character: access token to be obtained from \url{https://microdatalib.worldbank.org/index.php/auth/api_keys}} \item{root}{character: the root url that hosts the API} } diff --git a/vignettes/getting_started.Rmd b/vignettes/getting_started.Rmd index adde35e..f9fa4cc 100644 --- a/vignettes/getting_started.Rmd +++ b/vignettes/getting_started.Rmd @@ -28,11 +28,11 @@ knitr::opts_chunk$set( ### Before you start: Get your API KEY You can get your API KEY by: -1. Visiting the [following link](http://microdatalibqa.worldbank.org/index.php/auth/api_keys) +1. Visiting the [following link](https://microdatalibqa.worldbank.org/index.php/auth/api_keys) 1. Loging using your World Bank SecureID token 1. Clicking the __create new key__ button. -API documentation can be accessed [here](http://microdatalibqa.worldbank.org/apidocumentation/#api-Metadata-datafile_variables) +API documentation can be accessed [here](https://microdatalibqa.worldbank.org/apidocumentation/#api-Metadata-datafile_variables) ### List all available surveys ```{r}