hurl-2.0.0.0: Haskell URL resolver
Safe HaskellNone
LanguageHaskell2010

Network.URI.Fetch

Description

Retrieves documents for a URL, supporting multiple URL schemes that can be disabled at build-time for reduced dependencies.

Synopsis

Documentation

data Session Source #

Data shared accross multiple URI requests.

newSession :: IO Session Source #

Initializes a default Session object to support HTTPS & Accept-Language if HTTP is enabled.

fetchURL Source #

Arguments

:: Session

The session of which this request is a part.

-> [String]

The expected MIMEtypes in priority order.

-> URI

The URL to retrieve

-> IO (String, Either Text ByteString)

The MIMEtype & possibly text-decoded response.

Retrieves a URL-identified resource & it's MIMEtype, possibly decoding it's text.

fetchURL' :: Session -> [String] -> URI -> IO (URI, String, Either Text ByteString) Source #

As per fetchURL, but also returns the redirected URI.

fetchURLs :: Session -> [String] -> [URI] -> ((URI, String, Either Text ByteString) -> IO a) -> IO [(URI, a)] Source #

Concurrently fetch given URLs.

mimeERR :: String Source #

Internal MIMEtypes for error reporting

htmlERR :: String Source #

Internal MIMEtypes for error reporting

data Application Source #

Constructors

Application 

Fields

saveDownload :: URI -> FilePath -> (URI, String, Either Text ByteString) -> IO URI Source #

write download to a file in the given directory.

downloadToURI :: (URI, String, Either Text ByteString) -> URI Source #

Convert a download into a data: URI