Maintainer | Ertugrul Soeylemez <[email protected]> |
---|
WebWire.Types
Description
Types used in webwire.
- data WebException
- data WebOutput
- type WebWire site = Wire (StateT (WebConfig site) IO)
- data RedirectType
- type SimpleWire = WebWire ()
- data WebConfig site = WebConfig {
- wcCookies :: Map ByteString ByteString
- wcCurrentPath :: [Text]
- wcPostParams :: Map ByteString ByteString
- wcPostFiles :: Map ByteString (FileInfo FilePath)
- wcQueryParams :: Map ByteString ByteString
- wcRequest :: Request
- wcRequestPath :: [Text]
- wcRootPath :: [Text]
- wcSetCookies :: Map ByteString ByteString
- wcSetHeaders :: [(CI Ascii, Ascii)]
- wcSite :: site
- wcWidget :: Widget
Common types
data WebException Source
A web exception is an HTTP status code possibly with additional data.
Constructors
WebException Status | Generic web exception. This can be an internal server error (5xx) or document error (4xx), which don't need additional data. |
WebRedirect Status Text | Redirection exception. The second argument specifies the URI to redirect to. |
Various output types. The boolean argument taken by the constructors specifies whether a Content-length header should be sent. If true, the string will be fully built, before being sent to the client.
Constructors
GenOutput Bool Ascii Builder | Generic data output |
HtmlOutput Bool Html | UTF-8-encoded HTML. |
TextOutput Bool Builder | UTF-8-encoded string. |
Utility types
data RedirectType Source
Types of redirection. For temporary redirections, especially in
response to handling a form, you will want to use RedirectSeeOther
.
Constructors
RedirectPermanent | Permanently moved (301). |
RedirectSeeOther | See other (303). |
RedirectTemporary | Temporary redirection (307). |
Simple sites
type SimpleWire = WebWire ()Source
Wire type for simple sites.
Internal
Runtime configuration of a wire.
Constructors
WebConfig | |
Fields
|