<div dir="ltr">Compile time error, plus I'm pretty sure the code <div>is not actually doing what I want it to. <br><div><br></div><div>Like I said, I want a post method that will add a row to the database, and a get that</div>
<div>will retrieve a list of the rows (as a JSON).</div><div><br></div><div>--Zach</div><div><br><br><div class="gmail_quote">On Tue, Mar 29, 2011 at 9:29 PM, Michael Snoyman <span dir="ltr"><<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Are you getting a compile-time error, or is the result at runtime not<br>
what you expected? More details will be helpful here.<br>
<font color="#888888"><br>
Michael<br>
</font><div><div></div><div class="h5"><br>
On Tue, Mar 29, 2011 at 8:58 PM, Zachary Kessin <<a href="mailto:zkessin@gmail.com">zkessin@gmail.com</a>> wrote:<br>
> Ok, I'm trying to setup a handler to take data from a HTTP post, and store<br>
> it into a<br>
> database, This is what I came up with, but its not right. Can someone tell<br>
> me what I am doing<br>
> wrong.<br>
> postPostMessageR :: Handler RepJson<br>
> postPostMessageR = do<br>
> liftIO $ putStrLn "POST"<br>
> CharecterPost clients _ <- getYesod<br>
> (text, charecter) <- do<br>
> text <- lookupPostParam "text"<br>
> charecter <- lookupPostParam "charecter"<br>
> case (text, charecter) of<br>
> (Just text', Just charecter') -> return (text', charecter')<br>
> _ -> invalidArgs ["text not provided."]<br>
><br>
> jsonToRepJson $ jsonMap (("text", text'),( "charecter", charecter'))<br>
><br>
> --Zach<br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> web-devel mailing list<br>
> <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
><br>
><br>
</div></div></blockquote></div><br></div></div></div>