rcurl

POST request using RCurl

怎甘沉沦 提交于 2019-11-26 14:03:37
问题 As a way of exploring how to make a package in R for the Denver RUG, I decided that it would be a fun little project to write an R wrapper around the datasciencetoolkit API. The basic R tools come from the RCurl package as you might imagine. I am stuck on a seemingly simple problem and I'm hoping that somebody in this forum might be able to point me in the right direction. The basic problem is that I can't seem to use postForm() to pass an un-keyed string as part of the data option in curl, i

How to use R to download a zipped file from a SSL page that requires cookies

岁酱吖の 提交于 2019-11-26 13:54:54
问题 I am trying to download a file from an https page that requires an "I Agree" button be pushed and then stores a cookie. My apologies if this answer is obvious somewhere.. When I open up the web page directly in Chrome and click "I Agree" - the file starts to download automatically. http://www.icpsr.umich.edu/cgi-bin/bob/zipcart2?path=SAMHDA&study=32722&bundle=delimited&ds=1&dups=yes I tried to replicate this example, but I don't think that hangseng website actually stores the cookie

How do I use cookies with RCurl?

断了今生、忘了曾经 提交于 2019-11-26 12:12:00
问题 I am trying to write an R package that accesses some data via a REST API. The API, however, doesn\'t use http authentication, but rather relies on cookies to keep credentials with the session. Essentially, I\'d like to replace the following two lines from a bash script with two R functions: One to perform the login, and store the session cookie, and the second to GET the data. curl -X POST -c cookies.txt -d\"username=xxx&password=yyy\" http://api.my.url/login curl -b cookies.txt http://api.my

How to login and then download a file from aspx web pages with R

扶醉桌前 提交于 2019-11-26 10:59:24
问题 I\'m trying to automate the download of the Panel Study of Income Dynamics files available on this web page using R. Clicking on any of those files takes the user through to this login/authentication page. After authentication, it\'s easy to download the files with your web browser. Unfortunately, the httr code below does not appear to be maintaining the authentication. I have tried inspecting the Headers in Chrome for the Login.aspx page (as described here), but it doesn\'t appear to