basicHeaderGatherer          package:RCurl          R Documentation

_F_u_n_c_t_i_o_n_s _f_o_r _p_r_o_c_e_s_s_i_n_g _t_h_e _r_e_s_p_o_n_s_e _h_e_a_d_e_r _o_f _a _l_i_b_c_u_r_l _r_e_q_u_e_s_t

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

     These two functions are used to collect the contents of the header
     of an HTTP response via the 'headerfunction' option of a curl
     handle and then processing that text into both the name: value
     pairs and also the initial line of the response that provides the
     status of the request. 'basicHeaderGatherer' is a simple special
     case of 'basicTextGatherer' with the built-in post-processing step
     done by 'parseHTTPHeader'.

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

     basicHeaderGatherer(txt = character(), max = NA)
     parseHTTPHeader(lines)

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

     txt: any initial text that we want included with the header. This
          is passed to 'basicTextGatherer'. Generally it should not be
          specified unless there is a good reason.

     max: This is passed directly to 'basicTextGatherer'

   lines: the text as a character vector from the response header that
          'parseHTTPHeader' will convert to a status and name-value
          pairs.

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

     The return value is the same as 'basicTextGatherer', i.e. a list
     with 'update', 'value' and 'reset' function elements. The 'value'
     element will invoke 'parseHTTPHeader' on the contents read during
     the processing of the  libcurl request and return that value.

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

     'basicTextGatherer' 'curlPerform'     'curlSetOpt'

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

       h = basicHeaderGatherer()
       getURI("http://www.omegahat.org/RCurl/index.html",
                headerfunction = h$update)
       names(h$value())
       h$value()

