I can't figure out how to get the Content-Length header from the response from a server:
import Network.HTTP.Conduit
main = do
headers <- getHeaders "http://fdsfdsfds.fd"
--??? this doesn't compile and a wrong way to go
head $ filter (\x -> hContentLength (fst x)) headers
getHeaders :: String -> IO ResponseHeaders
getHeaders url = do
req <- parseUrl url
res <- withManager $ httpLbs req
return $ responseHeaders res
Your suggestions?