2018-03-13 02:42:24 +03:00
|
|
|
::
|
2020-12-06 03:20:42 +03:00
|
|
|
/- *json-rpc
|
2018-03-13 02:42:24 +03:00
|
|
|
::
|
|
|
|
|_ res=response
|
|
|
|
::
|
2020-05-05 06:21:05 +03:00
|
|
|
++ grad %noun
|
|
|
|
++ grow
|
|
|
|
|%
|
|
|
|
++ noun res
|
|
|
|
--
|
2018-03-13 02:42:24 +03:00
|
|
|
++ grab :: convert from
|
|
|
|
|%
|
|
|
|
++ noun response :: from noun
|
2018-10-30 21:41:35 +03:00
|
|
|
++ httr :: from httr
|
2020-11-25 23:22:55 +03:00
|
|
|
|= hit=httr:eyre
|
2018-10-30 21:41:35 +03:00
|
|
|
^- response
|
|
|
|
~| hit
|
2020-11-25 22:39:13 +03:00
|
|
|
?: ?=(%2 (div p.hit 100))
|
2018-10-30 21:41:35 +03:00
|
|
|
=, html
|
2018-11-14 05:18:01 +03:00
|
|
|
%- json
|
|
|
|
?~ r.hit
|
|
|
|
a+~
|
|
|
|
(need (de-json q:u.r.hit))
|
2018-10-30 21:41:35 +03:00
|
|
|
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
|
|
|
--
|
|
|
|
--
|