Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Resource m = Resource {
- allowMissingPost :: Webmachine m Bool
- allowedMethods :: Webmachine m [Method]
- contentTypesAccepted :: Webmachine m [(MediaType, Webmachine m ())]
- contentTypesProvided :: Webmachine m [(MediaType, Webmachine m ResponseBody)]
- deleteCompleted :: Webmachine m Bool
- deleteResource :: Webmachine m Bool
- entityTooLarge :: Webmachine m Bool
- forbidden :: Webmachine m Bool
- generateETag :: Webmachine m (Maybe ETag)
- implemented :: Webmachine m Bool
- isAuthorized :: Webmachine m Bool
- isConflict :: Webmachine m Bool
- knownContentType :: Webmachine m Bool
- lastModified :: Webmachine m (Maybe UTCTime)
- languageAvailable :: Webmachine m Bool
- malformedRequest :: Webmachine m Bool
- movedPermanently :: Webmachine m (Maybe ByteString)
- movedTemporarily :: Webmachine m (Maybe ByteString)
- multipleChoices :: Webmachine m Bool
- previouslyExisted :: Webmachine m Bool
- processPost :: Webmachine m (PostResponse m)
- resourceExists :: Webmachine m Bool
- serviceAvailable :: Webmachine m Bool
- uriTooLong :: Webmachine m Bool
- validContentHeaders :: Webmachine m Bool
- data PostResponse m
- = PostCreate [Text]
- | PostCreateRedirect [Text]
- | PostProcess (Webmachine m ())
- | PostProcessRedirect (Webmachine m ByteString)
- serverError :: Monad m => Webmachine m a
- defaultResource :: Monad m => Resource m
Documentation
Resource | |
|
MonadWriter [(Route, Resource m)] (RoutingSpec m) |
data PostResponse m Source
Used when processing POST requests so as to handle the outcome of the binary decisions between handling a POST as a create request and whether to redirect after the POST is done. Credit for this idea goes to Richard Wallace (purefn) on Webcrank.
PostCreate [Text] | Treat this request as a PUT. |
PostCreateRedirect [Text] | Treat this request as a PUT, then redirect. |
PostProcess (Webmachine m ()) | Process as a POST, but don't redirect. |
PostProcessRedirect (Webmachine m ByteString) | Process and redirect. |
serverError :: Monad m => Webmachine m a Source
A helper function that terminates execution with 500 Internal Server Error
.
defaultResource :: Monad m => Resource m Source
The default Airship resource, with "sensible" values filled in for each entry. You construct new resources by extending the default resource with your own handlers.