| Safe Haskell | None |
|---|
Control.Monad.Apiary.Action
Contents
- data ActionT m a
- data ApiaryConfig = ApiaryConfig {}
- stop :: Monad m => ActionT m a
- stopWith :: Monad m => Response -> ActionT m a
- getRequest :: Monad m => ActionT m Request
- getHeaders :: Monad m => ActionT m RequestHeaders
- getReqParams :: MonadIO m => ActionT m [Param]
- getReqFiles :: MonadIO m => ActionT m [File ByteString]
- status :: Monad m => Status -> ActionT m ()
- addHeader :: Monad m => HeaderName -> ByteString -> ActionT m ()
- setHeaders :: Monad m => ResponseHeaders -> ActionT m ()
- modifyHeader :: Monad m => (ResponseHeaders -> ResponseHeaders) -> ActionT m ()
- contentType :: Monad m => ByteString -> ActionT m ()
- file :: Monad m => FilePath -> Maybe FilePart -> ActionT m ()
- file' :: Monad m => FilePath -> Maybe FilePart -> ActionT m ()
- builder :: Monad m => Builder -> ActionT m ()
- lbs :: Monad m => ByteString -> ActionT m ()
- stream :: Monad m => StreamingBody -> ActionT m ()
- response :: Monad m => (Status -> ResponseHeaders -> Response) -> ActionT m ()
- redirect :: Monad m => ByteString -> ActionT m ()
- redirectPermanently :: Monad m => ByteString -> ActionT m ()
- redirectTemporary :: Monad m => ByteString -> ActionT m ()
- redirectWith :: Monad m => Status -> ByteString -> ActionT m ()
- module Data.Default.Class
- redirectFound :: Monad m => ByteString -> ActionT m ()
- redirectSeeOther :: Monad m => ByteString -> ActionT m ()
- source :: Monad m => StreamingBody -> ActionT m ()
Documentation
Instances
| MonadTrans ActionT | |
| MonadTransControl ActionT | |
| MonadBase b m => MonadBase b (ActionT m) | |
| MonadBaseControl b m => MonadBaseControl b (ActionT m) | |
| MonadReader r m => MonadReader r (ActionT m) | |
| Monad m => Monad (ActionT m) | |
| Functor (ActionT m) | |
| Monad m => MonadPlus (ActionT m) | |
| Applicative (ActionT m) | |
| (Monad m, Functor m) => Alternative (ActionT m) | |
| MonadThrow m => MonadThrow (ActionT m) | |
| MonadCatch m => MonadCatch (ActionT m) | |
| MonadMask m => MonadMask (ActionT m) | |
| MonadIO m => MonadIO (ActionT m) |
data ApiaryConfig Source
Constructors
| ApiaryConfig | |
Fields
| |
Instances
actions
getter
getRequest :: Monad m => ActionT m RequestSource
get raw request. since 0.1.0.0.
getHeaders :: Monad m => ActionT m RequestHeadersSource
get all request headers. since 0.6.0.0.
getReqParams :: MonadIO m => ActionT m [Param]Source
parse request body and return params. since 0.9.0.0.
getReqFiles :: MonadIO m => ActionT m [File ByteString]Source
parse request body and return files. since 0.9.0.0.
setter
response header
addHeader :: Monad m => HeaderName -> ByteString -> ActionT m ()Source
add response header. since 0.1.0.0.
setHeaders :: Monad m => ResponseHeaders -> ActionT m ()Source
set response headers. since 0.1.0.0.
modifyHeader :: Monad m => (ResponseHeaders -> ResponseHeaders) -> ActionT m ()Source
modify response header. since 0.1.0.0.
contentType :: Monad m => ByteString -> ActionT m ()Source
set content-type header. if content-type header already exists, replace it. since 0.1.0.0.
response body
file :: Monad m => FilePath -> Maybe FilePart -> ActionT m ()Source
set response body file content and detect Content-Type by extension. since 0.1.0.0.
file' :: Monad m => FilePath -> Maybe FilePart -> ActionT m ()Source
set response body file content, without set Content-Type. since 0.1.0.0.
lbs :: Monad m => ByteString -> ActionT m ()Source
set response body lazy bytestring. since 0.1.0.0.
stream :: Monad m => StreamingBody -> ActionT m ()Source
set response body source. since 0.9.0.0.
response :: Monad m => (Status -> ResponseHeaders -> Response) -> ActionT m ()Source
Raw response constructor. since 0.10.
example(use pipes-wai)
producer :: Monad m => Producer (Flush Builder) IO () -> ActionT m () producer = response (s h -> responseProducer s h)
monolithic action
redirect
redirect :: Monad m => ByteString -> ActionT m ()Source
redirect with:
303 See Other (HTTP/1.1) or 302 Moved Temporarily (Other)
since 0.6.2.0.
redirectPermanently :: Monad m => ByteString -> ActionT m ()Source
redirect with 301 Moved Permanently. since 0.3.3.0.
redirectTemporary :: Monad m => ByteString -> ActionT m ()Source
redirect with:
307 Temporary Redirect (HTTP/1.1) or 302 Moved Temporarily (Other)
since 0.3.3.0.
Arguments
| :: Monad m | |
| => Status | |
| -> ByteString | Location redirect to |
| -> ActionT m () |
redirect handler
set status and add location header. since 0.3.3.0.
rename from redirect in 0.6.2.0.
Reexport
module Data.Default.Class
deprecated
redirectFound :: Monad m => ByteString -> ActionT m ()Source
Deprecated: use redirect
redirect with 302 Found. since 0.3.3.0.
redirectSeeOther :: Monad m => ByteString -> ActionT m ()Source
Deprecated: use redirect
redirect with 303 See Other. since 0.3.3.0.
source :: Monad m => StreamingBody -> ActionT m ()Source
Deprecated: use stream