I would like to post data to a web form from R, and retrieve the result. Is this possible at all?
In particular, I would like to pass a text file to this website http://ionspectra.org/aristo/batchmode/ and retrieve the result.
The post method the website uses is
<form action="../batchreport/" method="post" enctype="multipart/form-data"><div style='display:none'><input type='hidden' name='csrfmiddlewaretoken' value='d9c49e206913e5d8b515bc9705ca2e09' />
First I would like to check the radio button "format" to Tab-delimited:
<input type="radio" name="format" value="tsv" /> Tab-delimited <br/>
Then I would like to upload a given file:
<input type="file" name="batchfile" size="20"><br/>
Then have the submit button clicked:
<input type="submit" value="Ontologize!" />
And finally have the resulting text file be retrieved.
Question is, can this be scripted from R, and if so, using what package?
Can it be done using RCurl
's postForm
perhaps? But if so, what would be the syntax in this case?
Any advice welcome!
cheers, Tom