hledger/hledger-web/Hledger/Web
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
..
Handler web: support adding new transactions via JSON PUT (#316) 2019-02-20 20:23:51 -08:00
Settings web: Conform layout to the rest of hledger-* packages 2018-06-24 14:18:06 +02:00
Widget web: Re-add 'balanced transaction' validation to add form 2019-02-20 14:57:04 -08:00
Application.hs web: add the same 6 JSON routes as in hledger-api (#316) 2019-02-18 23:57:58 -08:00
Foundation.hs web: Fix compilation errors for all 'stack.yaml's 2018-06-25 12:00:18 +02:00
Import.hs web: Fix compilation errors for all 'stack.yaml's 2018-06-25 12:00:18 +02:00
Json.hs web: better ToJSON instances, new FromJSON instances, utilities (#316) 2019-02-20 20:23:45 -08:00
Main.hs remove some unneeded CPP pragmas 2018-08-02 08:25:49 +01:00
Settings.hs web: Conform layout to the rest of hledger-* packages 2018-06-24 14:18:06 +02:00
WebOptions.hs web: document --capabilities/--capabilities-header, editing 2019-02-18 14:40:14 -08:00