¤ urlFetchF, HttpReq, et al

Fetching documents

Types

urlFetchF :: F HttpReq HttpResp
type HttpReq = HttpRequest URL
type HttpResp = Either String (URL, Either String HttpResponse)

Description

urlFetchF is a fudget that fetches documents from given URLs. It supports the HTTP, FTP, Gopher and NNTP (for news) protocols. It also handles local files and directories.

Input

A HTTP request. This will cause urlFetchF to start fetching a document.

Output

While a document is being fetched, status messages may be output in the form Left message where message is a string.

When a complete document has been received, urlFetchF outputs Right (url,Right result), where url is the URL of the requested document and result is the response containing the document.

If a requested document could not be fected, urlFetchF outputs Right (url,Left error), where error is an error message.

See Also

A simpler fudget for fetching HTML: htmlFetchF.

The types HttpRequest, HttpResponse and URL.