【发布时间】:2014-11-30 04:50:20
【问题描述】:
我一直在尝试使用基于Reddit's github 的示例的 RCurl 从 R 向 Reddit 进行身份验证:
curl -X POST -d 'grant_type=password&username=reddit_bot&password=snoo' --user 'p-jcoLKBynTLew:gko_LXELoV07ZBNUXrvWZfzE3aI' https://ssl.reddit.com/api/v1/access_token
我尝试将其转换为 RCurl 命令,如下所示:
postForm("https://ssl.reddit.com/api/v1/access_token?grant_type=password",
username = "MyUserName",
password = "MyPassword",
.opts = list(userpwd = "MyClientid:MySecret")
)
但我得到一个错误:Error: Unauthorized
我不确定将 curl 命令转换为 Rcurl 的真正目的是什么。感谢您提供的任何帮助!
【问题讨论】: