I have a uri "/my-uri", when a get request is made I want to return whatever information I have, and when a post request made, I want to update that information.<div>I had thought that doing this:</div><div><br clear="all">
<div><div>(define-easy-handler(get-business :uri "/business" :default-request-type :get)()</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(with-html-output-to-string (*standard-output* nil :prologue nil :indent t)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>(format t "{\"success\":true, \"data\": ~a}" </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(encode-json-plist-to-string (business::find-business)))))</div>
<div><br></div><div>(define-easy-handler(post-business :uri "/business" :default-request-type :post)<span class="Apple-tab-span" style="white-space:pre"> </span>(business-name)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(with-html-output-to-string( *standard-output* nil :prologue nil :indent t)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>(format t "post-business - ~a" business-name)))</div></div><div><br></div><div>would accomplish that. However, the second handler is always called, for the get and the post. </div>
<div>I'm new to Lisp, and was wondering what I'm missing.</div><div>Any help would be greatly appreciated.</div>-- <br>James A Barrows<br><br>
</div>