[Ur] Handling POST requests that aren't from forms

Chris Double chris.double at double.co.nz
Wed Dec 15 03:40:40 EST 2010


I want to use an external service that regularly sends a POST request
to my Ur/Web application containing text data as the body of the POST.
I tried something like the following to log to a file:

fun notifyMessage body =
  dml (INSERT INTO messages (Message) VALUES ({[body]}));
  return <xml>0</xml>

Where 'messages' is a table containing the string that is the message.
This won't build in Ur/Web because 'notifyMessage' has as side effect
and Ur/Web is telling me to use it in a form. But the function isn't
actually used anywhere in my application itself - it's POSTed to
directly from an other service.

How can I write something in Ur/Web to handle this POST?

Chris.
-- 
http://www.bluishcoder.co.nz



More information about the Ur mailing list