Skip to content

Instantly share code, notes, and snippets.

@cmoore
Created July 21, 2009 17:29
Show Gist options
  • Save cmoore/151474 to your computer and use it in GitHub Desktop.
Save cmoore/151474 to your computer and use it in GitHub Desktop.
--
-- (env .> "first_name") = the post-ed field "first_name"
--
(.>) :: Env -> String -> String
(.>) env k =
case requestMethod env of
POST ->
do
let ( posts, _ ) = parsePost ctype clen $ hackInput env
fromMaybe "" $ lookup k posts
where
ctype = fromMaybe "" $ lookup "Content-Type" $ http env
clen = fromMaybe "" $ lookup "Content-Length" $ http env
_ ->
""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment