happstack-server-7.1.7.1: Web related tools and services.

Safe Haskell | None

Happstack.Server.Compression

Description

Filter for compressing the `Response` body.

Synopsis

- compressedResponseFilter :: (FilterMonad Response m, MonadPlus m, WebMonad Response m, ServerMonad m) => m String

# Documentation

compressedResponseFilter

Arguments

:: (FilterMonad Response m, MonadPlus m, WebMonad Response m, ServerMonad m) |
=> m String | name of the encoding chosen

reads the `Accept-Encoding` header. Then, if possible will compress the response body with methods `gzip` or `deflate`.

     main =
       simpleHTTP nullConf $
          do str <- compressedResponseFilter
             return $ toResponse ("This response compressed using: " ++ str)