-- 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:
--   
--   <pre>
--   import Network.Curl.Download
--   </pre>
--   
--   Loading a webpage as a <a>ByteString</a>:
--   
--   <pre>
--   doc  &lt;- openURI "http://haskell.org"
--   </pre>
--   
--   Loading from a file:
--   
--   <pre>
--   doc  &lt;- openURI "file:///tmp/A.hs"
--   </pre>
--   
--   Loading a HTML page as a list of tags:
--   
--   <pre>
--   tags &lt;- openAsTags "http://haskell.org"
--   </pre>
--   
--   Loading a HTML page as XML:
--   
--   <pre>
--   tags &lt;- openAsXML "http://haskell.org"
--   </pre>
--   
--   Loading an RSS or Atom feed:
--   
--   <pre>
--   feed &lt;- openAsFeed "http://haskell.org"
--   </pre>
--   
--   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 <a>ByteString</a>.
--   
--   Error handling is encapsulated in the <a>Either</a> type.
module Network.Curl.Download.Lazy

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

-- | Like openURI, but takes curl options.
--   
--   Examples:
--   
--   <pre>
--   openLazyURIWithOpts [CurlPost True] "http://haskell.org"
--   </pre>
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, <a>ByteString</a> or parsed as
--   HTML tags, XML or RSS and Atom feeds.
--   
--   Error handling is encapsulated in the <a>Either</a> type.
module Network.Curl.Download

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

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

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

-- | Download the content as for <a>openURI</a>, 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:
--   
--   <pre>
--   openURIWithOpts [CurlPost True] "http://haskell.org"
--   </pre>
openURIWithOpts :: [CurlOption] -> String -> IO (Either String ByteString)
