[R] RCurl HTTP Post ?
Duncan Temple Lang
duncan at wald.ucdavis.edu
Sat Feb 19 16:24:17 CET 2011
On 2/17/11 3:54 PM, Hasan Diwan wrote:
> According to [1] and [2], using RCurl to post a form with basic
> authentication is done using the postForm method. I'm trying to post
> generated interpolation data from R onto an HTTP form. The call I'm using is
> page <- postForm('http://our.server.com/dbInt/new', opts =
> curlOptions=(userpwd="test:test", verbose=T), profileid = "-1",
> value="1.801", type="history"). The page instance shows the HTTP response
> 500 screen and I get a nullpointerexception in the server logs.
Do you mean that the R variable page gives information about the request error
and contains the 500 error code? Not sure what you mean by "screen" here.
Client-server interactions are hard to debug as the problems can be on either
side or in the communication. The error can be in your request, in RCurl,
on the server side receiving the request or in the script processing the request
on the server.
So it is imperative to try to get diagnostic information.
You used verbose = T (TRUE). What did that display?
postForm() has a style parameter. It controls how the POST request is
submitted, either application/x-www-form-urlencoded or multipart/form-data.
Your server script might be expecting the data in a different format
than is being sent. postForm() defaults to the www-form-urlencoded.
But we will need more information to help you if these are not the
cause of the problem.
D.
> The line it
> points to is dealing with getting an integer out of "profileid". Help?
> Many thanks in advance...
More information about the R-help
mailing list