httpd-shed-0.4: A simple web-server with an interact style API

PortabilityGHC
Stabilityunstable
MaintainerAndy Gill <andygill@ku.edu>

Network.Shed.Httpd

Description

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), and Chunking support was written by Henning Thielemann. Handling of POST-based payloads was been written by Brandon Moore. initServerBind support was written by John Van Enk.

Synopsis

Documentation

initServerSource

Arguments

:: Int

The port number

-> (Request -> IO Response)

The functionality of the Server

-> IO Server

A token for the Server

This server transfers documents as one parcel, using the content-length header.

initServerLazySource

Arguments

:: Int

Chunk size

-> Int

The port number

-> (Request -> IO Response)

The functionality of the Server

-> 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.

initServerBindSource

Arguments

:: Int

The port number

-> HostAddress

The host address

-> (Request -> IO Response)

The functionality of the Server

-> IO Server

A token for the Server

This server transfers documents as one parcel, using the content-length header, and takes an additional

data Request Source

Constructors

Request 

Instances

data Response Source

Constructors

Response 

Fields

resCode :: Int
 
resHeaders :: [(String, String)]
 
resBody :: String
 

Instances

queryToArguments :: String -> [(String, String)]Source

Takes an escaped query, optionally starting with ?, and returns an unescaped index-value list.