Safe Haskell | None |
---|
- data Action a
- data ApiaryConfig = ApiaryConfig {}
- stop :: Action a
- stopWith :: Response -> Action a
- getRequest :: Action Request
- getHeaders :: Action RequestHeaders
- status :: Status -> Action ()
- addHeader :: HeaderName -> ByteString -> Action ()
- setHeaders :: ResponseHeaders -> Action ()
- modifyHeader :: (ResponseHeaders -> ResponseHeaders) -> Action ()
- contentType :: ByteString -> Action ()
- file :: FilePath -> Maybe FilePart -> Action ()
- file' :: FilePath -> Maybe FilePart -> Action ()
- builder :: Builder -> Action ()
- lbs :: ByteString -> Action ()
- source :: Source IO (Flush Builder) -> Action ()
- redirect :: ByteString -> Action ()
- redirectPermanently :: ByteString -> Action ()
- redirectTemporary :: ByteString -> Action ()
- redirectWith :: Status -> ByteString -> Action ()
- module Data.Default.Class
- redirectFound :: ByteString -> Action ()
- redirectSeeOther :: ByteString -> Action ()
Documentation
data ApiaryConfig Source
ApiaryConfig | |
|
actions
getter
getRequest :: Action RequestSource
get raw request. since 0.1.0.0.
getHeaders :: Action RequestHeadersSource
get all request headers. since 0.6.0.0.
setter
response header
addHeader :: HeaderName -> ByteString -> Action ()Source
add response header. since 0.1.0.0.
setHeaders :: ResponseHeaders -> Action ()Source
set response headers. since 0.1.0.0.
modifyHeader :: (ResponseHeaders -> ResponseHeaders) -> Action ()Source
modify response header. since 0.1.0.0.
contentType :: ByteString -> Action ()Source
set content-type header. if content-type header already exists, replace it. since 0.1.0.0.
response body
file :: FilePath -> Maybe FilePart -> Action ()Source
set response body file content and detect Content-Type by extension. since 0.1.0.0.
file' :: FilePath -> Maybe FilePart -> Action ()Source
set response body file content, without set Content-Type. since 0.1.0.0.
lbs :: ByteString -> Action ()Source
set response body lazy bytestring. since 0.1.0.0.
monolithic action
redirect
redirect :: ByteString -> Action ()Source
redirect with:
303 See Other (HTTP/1.1) or 302 Moved Temporarily (Other)
since 0.6.2.0.
redirectPermanently :: ByteString -> Action ()Source
redirect with 301 Moved Permanently. since 0.3.3.0.
redirectTemporary :: ByteString -> Action ()Source
redirect with:
307 Temporary Redirect (HTTP/1.1) or 302 Moved Temporarily (Other)
since 0.3.3.0.
:: Status | |
-> ByteString | Location redirect to |
-> Action () |
redirect handler
set status, add location header. since 0.3.3.0.
rename from redirect in 0.6.2.0.
Reexport
module Data.Default.Class
deprecated
redirectFound :: ByteString -> Action ()Source
Deprecated: use redirect
redirect with 302 Found. since 0.3.3.0.
redirectSeeOther :: ByteString -> Action ()Source
Deprecated: use redirect
redirect with 303 See Other. since 0.3.3.0.