Ketchup-0.2.3: A super small web framework for those who don't like big and fancy codebases

Safe HaskellNone

Ketchup.Utils

Synopsis

Documentation

trim :: ByteString -> ByteStringSource

Trim whitespace from headers

breakBS :: ByteString -> ByteString -> (ByteString, ByteString)Source

ByteString breakSubstring wrapper that drops delimiters

parseBody :: ByteString -> Map ByteString ByteStringSource

Parse a URL-encoded Request

sendReplySource

Arguments

:: Socket

Socket to write to

-> Int

Status Code to send

-> [(ByteString, [ByteString])]

HTTP headers (Header,[value1, value2])

-> ByteString

Body

-> IO () 

Send a HTTP reply Sends a reply with the given parameters

sendBadRequest :: Socket -> IO ()Source

Send 400 Bad Request error

sendNotFound :: Socket -> IO ()Source

Send 404 Not Found error

statusMsgSource

Arguments

:: Int

Status code (ex. 404)

-> ByteString

Status message (ex. 404 Not Found)

Status Messages Returns status message from a given status id