\Header{httpclient}{Read text from an HTTP server}
\keyword{file}{httpclient}
\begin{Description}\relax
The function reads text from a URL on an HTTP server into the specified
file. It checks for HTTP errors but will behave incorrectly if the data
being read contains binary zeros.  This function is used by the "socket"
method of \code{\Link{download.file}}.\end{Description}
\begin{Usage}
\begin{verbatim}
httpclient(url, port=80, error.is.fatal=TRUE, check.MIME.type=TRUE,
           file=tempfile(), drop.ctrl.z=TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{url}] The URL to read from
\item[\code{port}] The port (usually 80)
\item[\code{error.is.fatal}] Stop if an error is encountered 
\item[\code{check.MIME.type}] Require the URL to have a MIME type known to be
plain ASCII
\item[\code{file}] The file to store the text.
\item[\code{drop.ctrl.z}] Drop ASCII EOF (CTRL-Z) characters from the text
\end{ldescription}
\end{Arguments}
\begin{Value}
The name of the file containing the downloaded text.\end{Value}
\begin{SeeAlso}\relax
\code{\Link{download.file}}, \code{\Link{read.table.url}}\end{SeeAlso}

