http-enumerator 0.7.1.8 → 0.7.2
raw patch · 2 files changed
+12/−11 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Network.HTTP.Enumerator: httpLbsRedirect :: (MonadIO m, Failure HttpException m) => Request m -> Manager -> m Response
+ Network.HTTP.Enumerator: httpLbsRedirect :: MonadIO m => Request m -> Manager -> m Response
- Network.HTTP.Enumerator: httpRedirect :: (MonadIO m, Failure HttpException m) => Request m -> (Status -> ResponseHeaders -> Iteratee ByteString m a) -> Manager -> Iteratee ByteString m a
+ Network.HTTP.Enumerator: httpRedirect :: MonadIO m => Request m -> (Status -> ResponseHeaders -> Iteratee ByteString m a) -> Manager -> Iteratee ByteString m a
- Network.HTTP.Enumerator: redirectIter :: (MonadIO m, Failure HttpException m) => Int -> Request m -> (Status -> ResponseHeaders -> Iteratee ByteString m a) -> Manager -> (Status -> ResponseHeaders -> Iteratee ByteString m a)
+ Network.HTTP.Enumerator: redirectIter :: MonadIO m => Int -> Request m -> (Status -> ResponseHeaders -> Iteratee ByteString m a) -> Manager -> (Status -> ResponseHeaders -> Iteratee ByteString m a)
- Network.HTTP.Enumerator: simpleHttp :: (MonadIO m, Failure HttpException m) => String -> m ByteString
+ Network.HTTP.Enumerator: simpleHttp :: MonadIO m => String -> m ByteString
Files
- Network/HTTP/Enumerator.hs +11/−10
- http-enumerator.cabal +1/−1
Network/HTTP/Enumerator.hs view
@@ -232,7 +232,8 @@ then putInsecureSocket man key ci else TLS.connClose ci return a)- (\se -> if isManaged+ (\se -> liftIO (TLS.connClose ci) >>+ if isManaged then withManagedConn man key open req step else throwError se) @@ -726,7 +727,7 @@ -- | Download the specified URL, following any redirects, and return the -- response body. ----- This function will 'failure' an 'HttpException' for any response with a+-- This function will 'throwIO' an 'HttpException' for any response with a -- non-2xx status code. It uses 'parseUrl' to parse the input. This function -- essentially wraps 'httpLbsRedirect'. --@@ -734,14 +735,14 @@ -- utilize lazy I/O, and therefore the entire response body will live in -- memory. If you want constant memory usage, you'll need to write your own -- iteratee and use 'http' or 'httpRedirect' directly.-simpleHttp :: (MonadIO m, Failure HttpException m) => String -> m L.ByteString+simpleHttp :: MonadIO m => String -> m L.ByteString simpleHttp url = do- url' <- parseUrl url+ url' <- liftIO $ parseUrl url Response sc _ b <- liftIO $ withManager $ httpLbsRedirect $ url' { decompress = browserDecompress } if 200 <= sc && sc < 300 then return b- else failure $ StatusCodeException sc b+ else liftIO $ throwIO $ StatusCodeException sc b data HttpException = StatusCodeException Int L.ByteString | InvalidUrlException String String@@ -753,7 +754,7 @@ -- | Same as 'http', but follows all 3xx redirect status codes that contain a -- location header. httpRedirect- :: (MonadIO m, Failure HttpException m)+ :: MonadIO m => Request m -> (W.Status -> W.ResponseHeaders -> Iteratee S.ByteString m a) -> Manager@@ -764,7 +765,7 @@ -- | Make a request automatically follow 3xx redirects. -- -- Used internally by 'httpRedirect' and family.-redirectIter :: (MonadIO m, Failure HttpException m)+redirectIter :: MonadIO m => Int -- ^ number of redirects to attempt -> Request m -- ^ Original request -> (W.Status -> W.ResponseHeaders -> Iteratee S.ByteString m a)@@ -787,7 +788,7 @@ , S8.unpack l'' ] _ -> S8.unpack l''- l <- lift $ parseUrl l'+ l <- liftIO $ parseUrl l' let req' = req { host = host l , port = port l@@ -800,7 +801,7 @@ else method l } if redirects == 0- then lift $ failure TooManyRedirects+ then liftIO $ throwIO TooManyRedirects else (http req') (redirectIter (redirects - 1) req' bodyStep manager) manager Nothing -> bodyStep s hs | otherwise = bodyStep s hs@@ -822,7 +823,7 @@ -- /not/ utilize lazy I/O, and therefore the entire response body will live in -- memory. If you want constant memory usage, you'll need to write your own -- iteratee and use 'http' or 'httpRedirect' directly.-httpLbsRedirect :: (MonadIO m, Failure HttpException m) => Request m -> Manager -> m Response+httpLbsRedirect :: MonadIO m => Request m -> Manager -> m Response httpLbsRedirect req = run_ . httpRedirect req lbsIter readMay :: Read a => String -> Maybe a
http-enumerator.cabal view
@@ -1,5 +1,5 @@ name: http-enumerator-version: 0.7.1.8+version: 0.7.2 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>