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.

  1. setHeader :: HasHeaders a => CI ByteString -> ByteString -> a -> a

    snap-core Snap.Internal.Core

    Sets a header key-value-pair in a HasHeaders datatype. If a header with the same name already exists, it is overwritten with the new value. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> setHeader "Host" "localhost" H.empty
    H {unH = [("host","localhost")]}
    ghci> setHeader "Host" "127.0.0.1" it
    H {unH = [("host","127.0.0.1")]}
    

  2. updateHeaders :: HasHeaders a => (Headers -> Headers) -> a -> a

    snap-core Snap.Internal.Core

    Modify the datatype's headers.

  3. class HasHeaders a

    snap-core Snap.Internal.Http.Types

    A typeclass for datatypes which contain HTTP headers.

  4. addHeader :: HasHeaders a => CI ByteString -> ByteString -> a -> a

    snap-core Snap.Internal.Http.Types

    Adds a header key-value-pair to the HasHeaders datatype. If a header with the same name already exists, the new value is appended to the headers list. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> addHeader "Host" "localhost" H.empty
    H {unH = [("host","localhost")]}
    ghci> addHeader "Host" "127.0.0.1" it
    H {unH = [("host","localhost,127.0.0.1")]}
    

  5. deleteHeader :: HasHeaders a => CI ByteString -> a -> a

    snap-core Snap.Internal.Http.Types

    Clears a header value from a HasHeaders datatype. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> deleteHeader "Host" $ setHeader "Host" "localhost" H.empty
    H {unH = []}
    

  6. getHeader :: HasHeaders a => CI ByteString -> a -> Maybe ByteString

    snap-core Snap.Internal.Http.Types

    Gets a header value out of a HasHeaders datatype. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> getHeader "Host" $ setHeader "Host" "localhost" H.empty
    Just "localhost"
    

  7. listHeaders :: HasHeaders a => a -> [(CI ByteString, ByteString)]

    snap-core Snap.Internal.Http.Types

    Lists all the headers out of a HasHeaders datatype. If many headers came in with the same name, they will be catenated together. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> listHeaders $ setHeader "Host" "localhost" H.empty
    [("host","localhost")]
    

  8. rqHeaders :: Request -> Headers

    snap-core Snap.Internal.Http.Types

    Contains all HTTP Headers associated with this request. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Snap.Test as T
    ghci> import qualified Data.Map as M
    ghci> rqHeaders `fmap` T.buildRequest (T.get "/foo/bar" M.empty)
    H {unH = [("host","localhost")]}
    

  9. rspHeaders :: Response -> Headers

    snap-core Snap.Internal.Http.Types

    No documentation available.

  10. setHeader :: HasHeaders a => CI ByteString -> ByteString -> a -> a

    snap-core Snap.Internal.Http.Types

    Sets a header key-value-pair in a HasHeaders datatype. If a header with the same name already exists, it is overwritten with the new value. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> setHeader "Host" "localhost" H.empty
    H {unH = [("host","localhost")]}
    ghci> setHeader "Host" "127.0.0.1" it
    H {unH = [("host","127.0.0.1")]}
    

Page 188 of many | Previous | Next