[web-devel] Yesod Examples
zkessin at gmail.com
Tue Mar 29 21:40:19 CEST 2011
Compile time error, plus I'm pretty sure the code
is not actually doing what I want it to.
Like I said, I want a post method that will add a row to the database, and a
will retrieve a list of the rows (as a JSON).
On Tue, Mar 29, 2011 at 9:29 PM, Michael Snoyman <michael at snoyman.com>wrote:
> Are you getting a compile-time error, or is the result at runtime not
> what you expected? More details will be helpful here.
> On Tue, Mar 29, 2011 at 8:58 PM, Zachary Kessin <zkessin at gmail.com> wrote:
> > Ok, I'm trying to setup a handler to take data from a HTTP post, and
> > it into a
> > database, This is what I came up with, but its not right. Can someone
> > 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the web-devel