Hoogle Search
Within LTS Haskell 24.67 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
setRsCode :: Monad m => Int -> Response -> m Responsehappstack-server Happstack.Server.Internal.Types Sets the Response status code to the provided Int and lifts the computation into a Monad.
setFilter :: FilterMonad a m => (a -> a) -> m ()happstack-server Happstack.Server.Monads Ignores all previous alterations to your filter As an example:
do composeFilter f setFilter g return "Hello World"
The setFilter g will cause the first composeFilter f to be ignored.setHeaderM :: FilterMonad Response m => String -> String -> m ()happstack-server Happstack.Server.Monads Set a header into the response. This will replace an existing header of the same name. Use addHeaderM if you want to add more than one header of the same name.
setResponseCode :: FilterMonad Response m => Int -> m ()happstack-server Happstack.Server.Response Set an arbitrary return code in your response. A filter for setting the response code. Generally you will use a helper function like ok or seeOther.
main = simpleHTTP nullConf $ do setResponseCode 200 return "Everything is OK"
see also: respsetHeader :: HasHeaders r => String -> String -> r -> rhappstack-server Happstack.Server.Types Associates the key/value pair in the headers. Forces the key to be lowercase.
setHeaderBS :: HasHeaders r => ByteString -> ByteString -> r -> rhappstack-server Happstack.Server.Types Acts as setHeader but with ByteStrings.
setHeaderUnsafe :: HasHeaders r => ByteString -> HeaderPair -> r -> rhappstack-server Happstack.Server.Types Sets the key to the HeaderPair. This is the only way to associate a key with multiple values via the setHeader* functions. Does not force the key to be in lowercase or guarantee that the given key and the key in the HeaderPair will match.
setRsCode :: Monad m => Int -> Response -> m Responsehappstack-server Happstack.Server.Types Sets the Response status code to the provided Int and lifts the computation into a Monad.
setValidator :: (Response -> IO Response) -> Response -> Responsehappstack-server Happstack.Server.Validation Set the validator which should be used for this particular Response when validation is enabled. Calling this function does not enable validation. That can only be done by enabling the validation in the Conf that is passed to simpleHTTP. You do not need to call this function if the validator set in Conf does what you want already. Example: (use noopValidator instead of the default supplied by validateConf)
simpleHTTP validateConf $ ok . setValidator noopValidator =<< htmlPage
See also: validateConf, wdgHTMLValidator, noopValidator, lazyProcValidator.setValidatorSP :: (Monad m, ToMessage r) => (Response -> IO Response) -> m r -> m Responsehappstack-server Happstack.Server.Validation ServerPart version of setValidator. Example: (Set validator to noopValidator)
simpleHTTP validateConf $ setValidatorSP noopValidator (dir "ajax" ... )