<div dir="ltr">Compile time error, plus I&#39;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">&lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt;</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 &lt;<a href="mailto:zkessin@gmail.com">zkessin@gmail.com</a>&gt; wrote:<br>
&gt; Ok, I&#39;m trying to setup a handler to take data from a HTTP post, and store<br>
&gt; it into a<br>
&gt; database, This is what I came up with, but its not right. Can someone tell<br>
&gt; me what I am doing<br>
&gt; wrong.<br>
&gt; postPostMessageR :: Handler RepJson<br>
&gt; postPostMessageR = do<br>
&gt;   liftIO $ putStrLn &quot;POST&quot;<br>
&gt;   CharecterPost clients _ &lt;- getYesod<br>
&gt;   (text, charecter) &lt;- do<br>
&gt;     text      &lt;- lookupPostParam &quot;text&quot;<br>
&gt;     charecter &lt;- lookupPostParam &quot;charecter&quot;<br>
&gt;     case (text, charecter) of<br>
&gt;       (Just text&#39;, Just charecter&#39;) -&gt;   return (text&#39;, charecter&#39;)<br>
&gt;       _              -&gt; invalidArgs [&quot;text not provided.&quot;]<br>
&gt;<br>
&gt;   jsonToRepJson $ jsonMap ((&quot;text&quot;, text&#39;),( &quot;charecter&quot;, charecter&#39;))<br>
&gt;<br>
&gt; --Zach<br>
</div></div><div><div></div><div class="h5">&gt; _______________________________________________<br>
&gt; web-devel mailing list<br>
&gt; <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div></div></div>