Safe Haskell | None |
---|
Network.Wai.Internal
Description
Internal constructors and helper functions. Note that no guarantees are given for stability of these interfaces.
- data Request = Request {
- requestMethod :: Method
- httpVersion :: HttpVersion
- rawPathInfo :: ByteString
- rawQueryString :: ByteString
- requestHeaders :: RequestHeaders
- isSecure :: Bool
- remoteHost :: SockAddr
- pathInfo :: [Text]
- queryString :: Query
- requestBody :: Source IO ByteString
- vault :: Vault
- requestBodyLength :: RequestBodyLength
- requestHeaderHost :: Maybe ByteString
- requestHeaderRange :: Maybe ByteString
- data Response
- = ResponseFile Status ResponseHeaders FilePath (Maybe FilePart)
- | ResponseBuilder Status ResponseHeaders Builder
- | ResponseSource Status ResponseHeaders (forall b. WithSource IO (Flush Builder) b)
- type WithSource m a b = (Source m a -> m b) -> m b
- data RequestBodyLength
- data FilePart = FilePart {}
Documentation
Information on the request sent by the client. This abstracts away the details of the underlying implementation.
Constructors
Request | |
Fields
|
The strange structure of the third field or ResponseSource is to allow for exception-safe resource allocation. As an example:
app :: Application app _ = return $ ResponseSource status200 [] $ \f -> bracket (putStrLn "Allocation" >> return 5) (\i -> putStrLn $ "Cleaning up: " ++ show i) (\_ -> f $ do yield $ Chunk $ fromByteString "Hello " yield $ Chunk $ fromByteString "World!")
Constructors
ResponseFile Status ResponseHeaders FilePath (Maybe FilePart) | |
ResponseBuilder Status ResponseHeaders Builder | |
ResponseSource Status ResponseHeaders (forall b. WithSource IO (Flush Builder) b) |
type WithSource m a b = (Source m a -> m b) -> m bSource
Auxiliary type for ResponseSource
.
data RequestBodyLength Source
The size of the request body. In the case of chunked bodies, the size will not be known.
Since 1.4.0
Constructors
ChunkedBody | |
KnownLength Word64 |