我不知道如何从服务器的响应中获取 Content-Length 标头:
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
你的建议?