hails-0.11.2.0: Multi-app web platform framework

Safe HaskellTrustworthy
LanguageHaskell98

Hails.HttpServer.Types

Contents

Synopsis

Requests

data Request Source

A request sent by the end-user.

Constructors

Request 

Fields

requestMethod :: Method

HTTP Request (e.g., GET, POST, etc.).

httpVersion :: HttpVersion

HTTP version (e.g., 1.1 or 1.0).

rawPathInfo :: ByteString

Extra path information sent by the client.

rawQueryString :: ByteString

If no query string was specified, this should be empty. This value will include the leading question mark. Do not modify this raw value- modify queryString instead.

serverName :: ByteString

Generally the host requested by the user via the Host request header. Backends are free to provide alternative values as necessary. This value should not be used to construct URLs.

requestHeaders :: RequestHeaders

The request headers.

isSecure :: Bool

Was this request made over an SSL connection?

remoteHost :: SockAddr

The client's host information.

pathInfo :: [Text]

Path info in individual pieces- the url without a hostname/port and without a query string, split on forward slashes,

queryString :: Query

Parsed query string information

requestBody :: ByteString

Lazy ByteString containing the request body.

requestTime :: UTCTime

Time request was received.

getRequestBodyType :: Request -> Maybe RequestBodyType Source

Get the request body type (copied from wai-extra).

removeRequestHeader :: Request -> HeaderName -> Request Source

Remove a header (if it exists) from the Request

Responses

data Response Source

A response sent by the app.

Constructors

Response 

Fields

respStatus :: Status

Response status

respHeaders :: ResponseHeaders

Response headers

respBody :: ByteString

Response body

removeResponseHeader :: Response -> HeaderName -> Response Source

Remove a header (if it exists) from the Response

Applications and middleware

type Application = RequestConfig -> DCLabeled Request -> DC Response Source

Base Hails type implemented by untrusted applications.

data RequestConfig Source

The settings with which the app will run.

Constructors

RequestConfig 

Fields

browserLabel :: DCLabel

The label of the browser the reponse will be sent to.

requestLabel :: DCLabel

The label of the incoming request (with the logged in user's integrity).

appPrivilege :: DCPriv

A privilege minted for the app.

type Middleware = Application -> Application Source

Convenience type for middleware components.