2018-03-13 02:42:24 +03:00
|
|
|
::
|
2018-03-13 16:42:49 +03:00
|
|
|
/- json-rpc
|
|
|
|
=, json-rpc
|
2018-03-13 02:42:24 +03:00
|
|
|
::
|
|
|
|
|_ res=response
|
|
|
|
::
|
|
|
|
++ grab :: convert from
|
|
|
|
|%
|
|
|
|
++ noun response :: from noun
|
2018-10-30 21:41:35 +03:00
|
|
|
++ httr :: from httr
|
|
|
|
|= hit/httr:eyre
|
|
|
|
^- response
|
|
|
|
~| hit
|
|
|
|
?: ?=($2 (div p.hit 100))
|
|
|
|
=, html
|
|
|
|
(json (need (de-json q:(need r.hit))))
|
|
|
|
fail+hit
|
2018-03-13 02:42:24 +03:00
|
|
|
++ 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-22 00:56:58 +03:00
|
|
|
=/ res=(unit [@t json])
|
2018-09-27 04:16:17 +03:00
|
|
|
::TODO breaks when no id present
|
2018-03-22 00:56:58 +03:00
|
|
|
((ot id+so result+some ~) a)
|
|
|
|
?^ res `[%result u.res]
|
2018-04-09 17:57:53 +03:00
|
|
|
~| a
|
2018-03-15 02:58:01 +03:00
|
|
|
:+ ~ %error %- need
|
2018-04-09 17:57:53 +03:00
|
|
|
((ot id+so error+(ot code+no message+so ~) ~) a)
|
2018-03-13 02:42:24 +03:00
|
|
|
--
|
|
|
|
--
|