curlPerform              package:RCurl              R Documentation

_P_e_r_f_o_r_m _t_h_e _H_T_T_P _q_u_e_r_y

_D_e_s_c_r_i_p_t_i_o_n:

     This function causes the HTTP query, that has been specified via
     the different options, to be sent and processed. Unlike in curl
     itself, 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.

_U_s_a_g_e:

     curlPerform(..., .opts = list(), curl = getCurlHandle())

_A_r_g_u_m_e_n_t_s:

    curl: the 'CURLHandle' object giving the structure for the options 
          and that will process the command.

     ...: a named list of curl options to set after the handle has been
          created.

   .opts: a named list or 'CURLOptions' object identifying the curl
          options for the handle.

_D_e_t_a_i_l_s:

_V_a_l_u_e:

     A integer value indicating the status of the request. This should
     be 0 as other errors will generate errors.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang <duncan@wald.ucdavis.edu>

_R_e_f_e_r_e_n_c_e_s:

     Curl homepage <URL: http://curl.haxx.se>

_S_e_e _A_l_s_o:

     'getURL' 'postForm' 'getForm' 'curlSetOpt'

_E_x_a_m_p_l_e_s:

       h = basicTextGatherer()
       curlPerform(url="http://www.omegahat.org/RCurl", writefunction = h$update)
        # Now read the text that was cumulated during the query response.
       h$value()

       # 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()

