Is there any way to assign variable to a http GET request form using rcurl?
eg:
getURL("https://testme.com/www//LoginService/login?login=xyz&password=<variable>")
I need to pass the value of password as a variable.
Regards ...
Is there any way to assign variable to a http GET request form using rcurl?
eg:
getURL("https://testme.com/www//LoginService/login?login=xyz&password=<variable>")
I need to pass the value of password as a variable.
Regards ...
What about using paste0
?
library("RCurl")
mypw <- "may1989"
basereq <- "https://testme.com/www//LoginService/login?login=xyz&password="
fullreq <- paste0( basereq, mypw, "/" )
So the full request looks like:
fullreq
## [1] "https://testme.com/www//LoginService/login?login=xyz&password=may1989/"
which you can curl in:
getURL(fullreq)
Try httr:
library(httr)
GET("https://testme.com/www/LoginService/login",
query = list(login = "xyz", password = variable)
)
httr will automatically escape variable
as needed.