A Credentials
object has a username and a password.
A Credentials
object can get API data via an API URL.
Rnssp::NSSPAuth
-> NSSPCredentials
Inherited methods
new()
Initializes a new Credentials object.
Credentials$new(username = NULL, password = NULL)
get_api_response()
Get API response
get_api_graph()
Get API graph
## ------------------------------------------------
## Method `Credentials$get_api_response`
## ------------------------------------------------
if (FALSE) {
myProfile <- Credentials$new(askme("Enter my username: "), askme())
url <- "https://httpbin.org/json"
api_response <- myProfile$get_api_response(url)
}
## ------------------------------------------------
## Method `Credentials$get_api_graph`
## ------------------------------------------------
if (FALSE) {
myProfile <- Credentials$new(askme("Enter my username: "), askme())
url <- "<url>"
api_data_graph <- myProfile$get_api_graph(url)
names(api_data_graph)
img <- png::readPNG(api_data_graph$graph)
grid::grid.raster(img)
}