[web-devel] Yesod Examples

Anton Cheshkov acheshkov at gmail.com
Tue Mar 29 21:06:16 CEST 2011


maybe you want:
jsonToRepJson $ jsonMap [("text", text'),( "charecter", charecter')]

check that turned on OverloadedStrings lang extension

2011/3/30 Zachary Kessin <zkessin at gmail.com>

> Ok, I'm trying to setup a handler to take data from a HTTP post, and store
> it into a
> database, This is what I came up with, but its not right. Can someone tell
> me what I am doing
> wrong.
>
> postPostMessageR :: Handler RepJson
> postPostMessageR = do
>   liftIO $ putStrLn "POST"
>   CharecterPost clients _ <- getYesod
>   (text, charecter) <- do
>     text      <- lookupPostParam "text"
>     charecter <- lookupPostParam "charecter"
>     case (text, charecter) of
>       (Just text', Just charecter') ->   return (text', charecter')
>       _              -> invalidArgs ["text not provided."]
>
>   jsonToRepJson $ jsonMap (("text", text'),( "charecter", charecter'))
>
>
> --Zach
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>
>


-- 
Best regards,
Cheshkov Anton
Phone: +7 909 005 18 82
Skype: cheshkov_anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110330/02ba2966/attachment-0001.htm>


More information about the web-devel mailing list