Portability | GHC |
---|---|
Stability | unstable |
Maintainer | Andy Gill <andygill@ku.edu> |
A trivial web server.
This web server promotes a Request to IO Response function into a local web server. The user can decide how to interpret the requests, and the library is intended for implementing Ajax APIs.
initServerLazy (and assocated refactorings) was written by Henning Thielemann.
- type Server = ()
- initServer :: Int -> (Request -> IO Response) -> IO Server
- initServerLazy :: Int -> Int -> (Request -> IO Response) -> IO Server
- data Request = Request {}
- data Response = Response {}
- queryToArguments :: String -> [(String, String)]
- addCache :: Int -> (String, String)
- noCache :: (String, String)
- contentType :: String -> (String, String)
Documentation
:: Int | The port number |
-> (Request -> IO Response) | The functionality of the Sever |
-> IO Server | A token for the Server |
This server transfers documents as one parcel, using the content-length header.
:: Int | Chunk size |
-> Int | The port number |
-> (Request -> IO Response) | The functionality of the Sever |
-> IO Server | A token for the Server |
This server transfers documents in chunked mode and without content-length header. This way you can ship infinitely big documents. It inserts the transfer encoding header for you.
queryToArguments :: String -> [(String, String)]Source
Takes an escaped query, optionally starting with ?
, and returns an unescaped index-value list.
contentType :: String -> (String, String)Source