2018-03-13 02:42:24 +03:00
|
|
|
::
|
2018-03-13 16:42:49 +03:00
|
|
|
/- json-rpc
|
2018-03-13 02:42:24 +03:00
|
|
|
/+ httr-to-json
|
2018-03-13 16:42:49 +03:00
|
|
|
=, json-rpc
|
2018-03-13 02:42:24 +03:00
|
|
|
::
|
|
|
|
|_ res=response
|
|
|
|
::
|
|
|
|
++ grab :: convert from
|
|
|
|
|%
|
|
|
|
++ noun response :: from noun
|
|
|
|
++ httr (cork httr-to-json json)
|
|
|
|
++ json :: from json
|
|
|
|
=, dejs-soft:format
|
|
|
|
|= a=json
|
|
|
|
^- response
|
2018-03-15 02:58:01 +03:00
|
|
|
=; dere
|
|
|
|
=+ res=((ar dere) a)
|
|
|
|
?~ res (need (dere a))
|
|
|
|
[%batch u.res]
|
|
|
|
|= a=json
|
|
|
|
^- (unit response)
|
2018-03-13 02:42:24 +03:00
|
|
|
=/ res=(unit @t)
|
|
|
|
((ot result+so ~) a)
|
2018-03-15 02:58:01 +03:00
|
|
|
?^ res `result+u.res
|
|
|
|
:+ ~ %error %- need
|
2018-03-13 02:42:24 +03:00
|
|
|
((ot code+so message+so ~) a)
|
|
|
|
--
|
|
|
|
--
|