sanity/LastCalc — pull request #5 by JamesEarlDouglas (2012-03-11 08:18:03+00:00)
Title: Toward console-based clients

I copied `WorksheetServlet`, without the stateful worksheets, to `StatelessServlet` to provide raw calculation as a Web service. This will let me write a console-based client using curl (or similar).

I tested the new servlet with the following, but I plan to pull it into a script to parse both arguments and the JSON output.

$ curl -w "\n" -d "{\"questions\":{\"2\":\"2 + 2\"}}" localhost:8888/sl
{"answers":{"1":"4"},"answerTypes":{"1":"NORMAL"},"variables":{}}