basicHeaderGatherer: Functions for processing the response header of a libcurl request
Description
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.
Usage
basicHeaderGatherer(txt = character(), max = NA)
parseHTTPHeader(lines)
Arguments
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.
the text as a character vector from the response header
that
parseHTTPHeader will convert to a status and name-value pairs.
Value
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.