-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | High-level file download based on URLs
--   
--   High-level file download based on URLs
--   
--   Download web content as strict or lazy bytestringrs, strings, HTML
--   tags, XML, RSS or Atom feeds or JSON, using the curl network library.
--   
--   Importing the library:
--   
--   
--   import Network.Curl.Download
--   
--   
--   Loading a webpage as a ByteString:
--   
--   
--   doc  <- openURI "http://haskell.org"
--   
--   
--   Loading from a file:
--   
--   
--   doc  <- openURI "file:///tmp/A.hs"
--   
--   
--   Loading a HTML page as a list of tags:
--   
--   
--   tags <- openAsTags "http://haskell.org"
--   
--   
--   Loading a HTML page as XML:
--   
--   
--   tags <- openAsXML "http://haskell.org"
--   
--   
--   Loading an RSS or Atom feed:
--   
--   
--   feed <- openAsFeed "http://haskell.org"
--   
--   
--   These data types can the be processed further with the XML, Feed and
--   TagSoup libraries.
@package download-curl
@version 0.1.4

-- | A binding to curl, an efficient, high level library for retrieving
--   files using Uniform Resource Locators (URLs).
--   
--   Content may be retrieved as a lazy ByteString.
--   
--   Error handling is encapsulated in the Either type.
module Network.Curl.Download.Lazy

-- | Download content specified by a url using curl, returning the content
--   as a lazy ByteString.
--   
--   If an error occurs, Left is returned, with a protocol-specific
--   error string.
--   
--   Examples:
--   
--   
--   openLazyURI "http://haskell.org"
--   
openLazyURI :: String -> IO (Either String ByteString)

-- | Like openURI, but takes curl options.
--   
--   Examples:
--   
--   
--   openLazyURIWithOpts [CurlPost True] "http://haskell.org"
--   
openLazyURIWithOpts :: [CurlOption] -> String -> IO (Either String ByteString)

-- | A binding to curl, an efficient, high level library for retrieving
--   files using Uniform Resource Locators (URLs).
--   
--   Content may be retrieved as a strings, ByteString or parsed as
--   HTML tags, XML or RSS and Atom feeds.
--   
--   Error handling is encapsulated in the Either type.
module Network.Curl.Download

-- | Download content specified by a url using curl, returning the content
--   as a strict ByteString.
--   
--   If an error occurs, Left is returned, with a protocol-specific
--   error string.
--   
--   Examples:
--   
--   
--   openURI "http://haskell.org"
--   
openURI :: String -> IO (Either String ByteString)

-- | Like openURI, but returns the result as a String
--   
--   Examples:
--   
--   
--   openURIString "http://haskell.org"
--   
openURIString :: String -> IO (Either String String)

-- | Download the content as for openURI, but return it as a list of
--   parsed tags using the tagsoup html parser.
openAsTags :: String -> IO (Either String [Tag String])

-- | Download the content as for openURI, but return it as parsed
--   XML, using the xml-light parser.
openAsXML :: String -> IO (Either String [Content])

-- | Download the content as for openURI, but return it as parsed
--   RSS or Atom content, using the feed library parser.
openAsFeed :: String -> IO (Either String Feed)

-- | Like openURI, but takes curl options.
--   
--   Examples:
--   
--   
--   openURIWithOpts [CurlPost True] "http://haskell.org"
--   
openURIWithOpts :: [CurlOption] -> String -> IO (Either String ByteString)
