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.
(define-easy-handler(get-business :uri "/business" :default-request-type :get)()
(with-html-output-to-string (*standard-output* nil :prologue nil :indent t)
(format t "{\"success\":true, \"data\": ~a}"
(encode-json-plist-to-string (business::find-business)))))
(define-easy-handler(post-business :uri "/business" :default-request-type :post) (business-name)
(with-html-output-to-string( *standard-output* nil :prologue nil :indent t)
(format t "post-business - ~a" business-name)))
would accomplish that. However, the second handler is always called, for the get and the post.
I'm new to Lisp, and was wondering what I'm missing.
Any help would be greatly appreciated.
--
James A Barrows