hascat-lib-0.2: Hascat Package

Hascat.Protocol

Contents

Synopsis

Documentation

data Input Source

The value of an input parameter, and some metadata.

Constructors

Input 

Instances

data ServletRequest Source

Constructors

ServletRequest 

Fields

rqURI :: URI
 
rqMethod :: RequestMethod
 
rqHeaders :: [Header]
 
rqInputs :: [(String, Input)]

Input parameters. For better laziness in reading inputs, this is not a Map.

rqBody :: ByteString
 

Instances

Inputs

decodeInput :: Request ByteString -> ServletRequestSource

Gets and decodes the input according to the request method and the content-type.

takeInputSource

Arguments

:: [Header] 
-> ByteString

Request body.

-> ByteString

CONTENT_LENGTH bytes from the request body, or the empty string if there is no CONTENT_LENGTH.

Takes the right number of bytes from the input.

URL encoding

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

Gets the name-value pairs from application/x-www-form-urlencoded data.

urlDecode :: String -> StringSource

Converts a single value from the application/x-www-form-urlencoded encoding.

Utilities

replaceSource

Arguments

:: Eq a 
=> a

Value to look for

-> a

Value to replace it with

-> [a]

Input list

-> [a]

Output list

Replaces all instances of a value in a list by another value.