将变量分配给R中的Get HTTP请求 [英] Assigning variables to the Get HTTP request in R

查看:155
本文介绍了将变量分配给R中的Get HTTP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用 rcurl 将变量分配给 http GET请求表单?

Is there any way to assign variable to a http GET request form using rcurl?

例如:

getURL("https://testme.com/www//LoginService/login?login=xyz&password=<variable>")

我需要传递密码值作为变量。

I need to pass the value of password as a variable.

问候......

推荐答案

如何使用 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/"

您可以卷入:

getURL(fullreq)

这篇关于将变量分配给R中的Get HTTP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆