curlSetOpt               package:RCurl               R Documentation

_S_e_t _v_a_l_u_e_s _f_o_r _t_h_e _C_U_R_L _o_p_t_i_o_n_s

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

     This function allows us to set values for the possible options in
     the CURL data structure that defines the HTTP request. These
     options persist across calls in the 'CURLHandle' object.

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

     curlSetOpt(..., .opts = list(), curl = getCurlHandle(),
                 .encoding = integer(), .forceHeaderNames = FALSE)

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

     ...: 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.

    curl: the 'CURLHandle' object created earlier via a call to
          'getCurlHandle' or 'dupCurlHandle'

.encoding: 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  'CE_UTF8' and 'CE_LATIN1'. 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. 

.forceHeaderNames: a logical value which if 'TRUE' allows the caller to
          explicitly indicate that the HTTPHEADER option needs to have
          the names prefixed to the strings. This removes any ambiguity
          caused by the presence of ':' in the values  appearing to be
          the separator between the name and the value of the 'name:
          value' pairs of the HTTP header.

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

     An integer value giving the status of the return. This should be 0
     as if there was an error in the libcurl mechiansim,   we will
     throw it there.

_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:

     'getCurlHandle' 'dupCurlHandle'

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

     curl = getCurlHandle()
       # Note the header that extends across two lines with the second line
       # prefixed with white space.
     curlSetOpt( .opts = list(httpheader = c(Date = "Wed, 1/2/2000 10:01:01",
                              foo="abc\n    extra line"), verbose = TRUE),
                  curl = curl) 
     ans = getURL("http://www.omegahat.org", curl = curl)

