0 | module TyTTP.HTTP.Consumer.JSON
 1 |
 2 | import Data.Buffer.Ext
 3 | import JSON
 4 | import TyTTP.HTTP.Consumer
 5 |
 6 | %hide JSON.Parser.JSON
 7 |
 8 | export
 9 | data JSON : Type where
10 |
11 | export
12 | implementation Accept JSON where
13 |   contentType _ = [ "application/json" ]
14 |
15 | export
16 | implementation FromJSON a => Consumer a JSON where
17 |   consumeRaw _ ct raw = 
18 |     mapFst show $ decode $ show raw
19 |