Re: [Rd] Post CGI forms with built-in R function?

From: Duncan Temple Lang <duncan_at_wald.ucdavis.edu>
Date: Wed 19 Jul 2006 - 16:21:48 GMT

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Mike

 If you don't want to have to download any packages but stick entirely within R, then you can mimic the code in httpRequest. But, as far as I know, there is no function in the standard R distribution to POST an HTTP request.

  As for using
   scan("http://....")

  what is the string you are using? Are you escaping all the characters correctly? What's the error message?

 If what you are doing involves only relatively basic HTTP requests, perhaps the simplest thing to do is use the httpRequest package on CRAN. It does the basics. You may have to handle chunked responses yourself and escaping certain characters. But that is a pure R solution that can be easily installed via install.packages().

Mike Schaffer wrote:
> I wrote a package that requires downloading data from an external
> server based on parameters specified by the user.
>
> I have used RMySQL or Rcurl to accomplish this, but in the interest
> of simplicity for users of this package, I'd like this communication
> to not require installing other packages and their dependencies (e.g.
> RMySQL, Rcurl, etc.). These dependencies are sometimes a deterrent
> to using my package.
>
> I set up a CGI script on the server to handle data requests. Now, is
> there a *built-in* R function that could be adapted to post forms or
> otherwise allows long URLs to be passed to this script to retrieve
> the data requested. I tried using just "scan", but it fails with
> long URLs (sometimes a long list of parameters is required). I think
> my only option is to use POST, but it doesn't appear it is possible
> without Rcurl.
>
> Can anyone help or suggest a "native" solution to the problem?
>
> Thanks.
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

iD8DBQFEvlwb9p/Jzwa2QP4RAvL1AJ9W/ixKDEl0KbH9yrGmTbEWsXoP+ACfXVdW vxQEDd6UsMXzX0baOPdhMvo=
=uzVj
-----END PGP SIGNATURE-----



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Jul 20 02:24:42 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 20 Jul 2006 - 14:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.