hledger/hledger-web/Hledger/Web/Handler
Simon Michael 2dc716cdb4 web: support adding new transactions via JSON PUT (#316)
A single transaction can be added by PUT to /add.
(I read that PUT, not POST, should be used to create;
perhaps the web add form should also use PUT ?)

As with the web form, the `add` capability is required (and enabled by
default).

Here's how to test with curl:

$ curl -s http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @in.json; echo

New readJsonFile/writeJsonFile helpers in Hledger.Web.Json
are handy for generating test data. Eg:

>>> writeJsonFile "in.json" (head $ jtxns samplejournal)
2019-02-20 20:23:51 -08:00
..
AddR.hs web: support adding new transactions via JSON PUT (#316) 2019-02-20 20:23:51 -08:00
EditR.hs web: Add capabilities guards and conditional widget rendering 2018-06-24 16:25:22 +02:00
JournalR.hs web: Add capabilities guards and conditional widget rendering 2018-06-24 16:25:22 +02:00
MiscR.hs web: better ToJSON instances, new FromJSON instances, utilities (#316) 2019-02-20 20:23:45 -08:00
RegisterR.hs web: fix tooltips showing transactions (fixes #927) 2019-02-18 07:55:29 -08:00
UploadR.hs web: Add capabilities guards and conditional widget rendering 2018-06-24 16:25:22 +02:00