Safe HaskellNone

Ketchup.Httpd

Synopsis

Documentation

data HTTPRequest

HTTP Request type This holds a complete HTTP request

Constructors

HTTPRequest 

Fields

method ∷ ByteString

Get HTTP Request Method (GET, POST etc.)

uri ∷ ByteString

Get Request URI

httpver ∷ ByteString

Get HTTP Version

headersHeaders

Get HTTP Headers (header, [values])

body ∷ ByteString

Get HTTP Post body (raw string)

Instances

type Headers = [(ByteString, [ByteString])]

type Handler = Socket → HTTPRequest → IO ()

listenHTTP

Arguments

∷ String

Address to bind (ie. *)

→ PortNumber

Port to listen on

Handler

Route function to call

→ IO () 

Listens for incoming HTTP request