Hoogle Search

Within LTS Haskell 23.26 (ghc-9.8.4)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. addHeader :: forall (h :: Symbol) v orig new . AddHeader '[Optional, Strict] h v orig new => v -> orig -> new

    servant Servant.API

    addHeader adds a header to a response. Note that it changes the type of the value in the following ways:

    1. A simple value is wrapped in "Headers '[hdr]":
    >>> let example0 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String;
    
    >>> getHeaders example0
    [("someheader","5")]
    
    1. A value that already has a header has its new header *prepended* to the existing list:
    >>> let example1 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String;
    
    >>> let example2 = addHeader True example1 :: Headers '[Header "1st" Bool, Header "someheader" Int] String
    
    >>> getHeaders example2
    [("1st","true"),("someheader","5")]
    
    Note that while in your handlers type annotations are not required, since the type can be inferred from the API type, in other cases you may find yourself needing to add annotations.

  2. addHeader :: forall (h :: Symbol) v orig new . AddHeader '[Optional, Strict] h v orig new => v -> orig -> new

    servant Servant.API.ResponseHeaders

    addHeader adds a header to a response. Note that it changes the type of the value in the following ways:

    1. A simple value is wrapped in "Headers '[hdr]":
    >>> let example0 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String;
    
    >>> getHeaders example0
    [("someheader","5")]
    
    1. A value that already has a header has its new header *prepended* to the existing list:
    >>> let example1 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String;
    
    >>> let example2 = addHeader True example1 :: Headers '[Header "1st" Bool, Header "someheader" Int] String
    
    >>> getHeaders example2
    [("1st","true"),("someheader","5")]
    
    Note that while in your handlers type annotations are not required, since the type can be inferred from the API type, in other cases you may find yourself needing to add annotations.

  3. addHeader :: MonadHandler m => Text -> Text -> m ()

    yesod-core Yesod.Core.Handler

    Set an arbitrary response header. Note that, while the data type used here is Text, you must provide only ASCII value to be HTTP compliant.

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

    snap-core Snap.Core

    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. addHeader :: HasHeaders a => CI ByteString -> ByteString -> a -> a

    snap-core Snap.Internal.Core

    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")]}
    

  6. 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")]}
    

  7. addHeader :: forall (m :: Type -> Type) . Monad m => CI ByteString -> ByteString -> RequestBuilder m ()

    snap-core Snap.Test

    Adds the given header to the request being built. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Data.Map as M
    ghci> :{
    ghci| buildRequest $ do get "/foo/bar" M.empty
    ghci|                   addHeader "Accept" "text/html"
    ghci|                   addHeader "Accept" "text/plain"
    ghci| :}
    GET /foo/bar HTTP/1.1
    accept: text/html,text/plain
    host: localhost
    
    sn="localhost" c=127.0.0.1:60000 s=127.0.0.1:8080 ctx=/ clen=n/a
    

  8. addHeader :: Text -> Text -> ActionM ()

    scotty Web.Scotty

    Add to the response headers. Header names are case-insensitive.

  9. addHeader :: forall (m :: Type -> Type) . MonadIO m => Text -> Text -> ActionT m ()

    scotty Web.Scotty.Trans

    Add to the response headers. Header names are case-insensitive.

  10. addHeader :: forall (m :: Type -> Type) . MonadIO m => Text -> Text -> ActionT m ()

    scotty Web.Scotty.Trans.Strict

    Add to the response headers. Header names are case-insensitive.

Page 1 of many | Next