EVOLUTION-MANAGER
Edit File: curlPerform.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Perform the HTTP query</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for curlPerform {RCurl}"><tr><td>curlPerform {RCurl}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Perform the HTTP query</h2> <h3>Description</h3> <p>These function causes the HTTP query, that has been specified via the different options in this and other calls, to be sent and processed. Unlike in curl itself, for <code>curlPerform</code> one can specify all the options in this call as an atomic invocation. This avoids having to set the options and then perform the action. Instead, this is all done in one call. </p> <p>For <code>curlMultiPerform</code>, one must add the relevant <code><a href="CURLHandle-class.html">CURLHandle-class</a></code> objects to the <code><a href="MultiCURLHandle-class.html">MultiCURLHandle-class</a></code> objects before issuing the call to <code>curlMultiPerform</code>. </p> <h3>Usage</h3> <pre> curlPerform(..., .opts = list(), curl = getCurlHandle(), .encoding = integer()) curlMultiPerform(curl, multiple = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>curl</code></td> <td> <p>for <code>curlPerform</code>, this is the <code>CURLHandle</code> object giving the structure for the options and that will process the command. For <code>curlMultiPerform</code>, this is an object of class code <code><a href="MultiCURLHandle-class.html">MultiCURLHandle-class</a></code>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>a named list of curl options to set after the handle has been created.</p> </td></tr> <tr valign="top"><td><code>.opts</code></td> <td> <p>a named list or <code>CURLOptions</code> object identifying the curl options for the handle. This is merged with the values of ... to create the actual options for the curl handle in the request.</p> </td></tr> <tr valign="top"><td><code>multiple</code></td> <td> <p>a logical value. If <code>TRUE</code> and the internal call to <code>curl_multi_perform</code> returns a value that indicates there is still data available from one of the HTTP responses, we call <code>curl_multi_perform</code> repeatedly until there is no more data available at that time. If this is <code>FALSE</code>, we call <code>curl_multi_perform</code> once and return, regardless of whether there is more data available. This is convenient if we want to limit the time spent in the call to <code>curlMultiPerform</code>. </p> </td></tr> <tr valign="top"><td><code>.encoding</code></td> <td> <p>an integer or a string that explicitly identifies the encoding of the content that is returned by the HTTP server in its response to our query. The possible strings are ‘UTF-8’ or ‘ISO-8859-1’ and the integers should be specified symbolically as <code>CE_UTF8</code> and <code>CE_LATIN1</code>. Note that, by default, the package attempts to process the header of the HTTP response to determine the encoding. This argument is used when such information is erroneous and the caller knows the correct encoding. </p> <p>Note that the encoding argument is not a regular libcurl option and is handled specially by RCurl. But as a result, it is not unset in subsequent uses of the curl handle (<code>curl</code>). </p> </td></tr> </table> <h3>Value</h3> <p>A integer value indicating the status of the request. This should be 0 as other errors will generate errors. </p> <h3>Author(s)</h3> <p>Duncan Temple Lang</p> <h3>References</h3> <p>Curl homepage <a href="http://curl.haxx.se">http://curl.haxx.se</a></p> <h3>See Also</h3> <p><code><a href="getURL.html">getURL</a></code> <code><a href="postForm.html">postForm</a></code> <code><a href="postForm.html">getForm</a></code> <code><a href="curlSetOpt.html">curlSetOpt</a></code> </p> <h3>Examples</h3> <pre> if(url.exists("http://www.omegahat.net/RCurl")) withAutoprint({ h = basicTextGatherer() curlPerform(url = "http://www.omegahat.net/RCurl", writefunction = h$update) # Now read the text that was cumulated during the query response. cat(h$value()) }) ## this no longer exists if(url.exists("http://services.soaplite.com/hibye.cgi")) withAutoprint({ # SOAP request body = '<?xml version="1.0" encoding="UTF-8"?>\ <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" \ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" \ xmlns:xsd="http://www.w3.org/1999/XMLSchema" \ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" \ xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">\ <SOAP-ENV:Body>\ <namesp1:hi xmlns:namesp1="http://www.soaplite.com/Demo"/>\ </SOAP-ENV:Body>\ </SOAP-ENV:Envelope>\n' h$reset() curlPerform(url = "http://services.soaplite.com/hibye.cgi", httpheader=c(Accept="text/xml", Accept="multipart/*", SOAPAction='"http://www.soaplite.com/Demo#hi"', 'Content-Type' = "text/xml; charset=utf-8"), postfields=body, writefunction = h$update, verbose = TRUE ) body = h$value() }) # Using a C routine as the reader of the body of the response. if(url.exists("http://www.omegahat.net/RCurl/index.html")) withAutoprint({ routine = getNativeSymbolInfo("R_internalWriteTest", PACKAGE = "RCurl")$address curlPerform(URL = "http://www.omegahat.net/RCurl/index.html", writefunction = routine) }) </pre> <hr /><div style="text-align: center;">[Package <em>RCurl</em> version 1.98-1.2 <a href="00Index.html">Index</a>]</div> </body></html>