Hoogle Search
Within LTS Haskell 24.58 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
buildHeaders :: [(ByteString, ByteString)] -> Headershttp-common Network.Http.Types Given a list of field-name,field-value pairs, construct a Headers map.
-
http-common Network.Http.Types No documentation available.
getHeader :: Response -> ByteString -> Maybe ByteStringhttp-common Network.Http.Types Lookup a header in the response. HTTP header field names are case-insensitive, so you can specify the name to lookup however you like. If the header is not present Nothing will be returned.
let n = case getHeader p "Content-Length" of Just x' -> read x' :: Int Nothing -> 0
which of course is essentially what goes on inside the client library when it receives a response from the server and has to figure out how many bytes to read. There is a fair bit of complexity in some of the other HTTP response fields, so there are a number of specialized functions for reading those values where we've found them useful.getHeaders :: HttpType τ => τ -> Headershttp-common Network.Http.Types Get the Headers from a Request or Response.y
lookupHeader :: Headers -> ByteString -> Maybe ByteStringhttp-common Network.Http.Types No documentation available.
removeHeader :: Headers -> ByteString -> Headershttp-common Network.Http.Types Remove a header from the map. If a field with that name is not present, then this will have no effect.
retrieveHeaders :: Headers -> [(ByteString, ByteString)]http-common Network.Http.Types Get the headers as a field-name,field-value association list.
setHeader :: ByteString -> ByteString -> RequestBuilder ()http-common Network.Http.Types Set a generic header to be sent in the HTTP request. The other methods in the RequestBuilder API are expressed in terms of this function, but we recommend you use them where offered for their stronger types.
updateHeader :: Headers -> ByteString -> ByteString -> Headershttp-common Network.Http.Types Set a header field to the specified value. This will overwrite any existing value for the field. Remember that HTTP fields names are case insensitive!
-
HTTP Link header parser/writer Library for the HTTP Link header as specified in RFC 5988 "Web Linking"