2018-03-13 02:42:24 +03:00
|
|
|
::
|
2019-02-03 22:58:03 +03:00
|
|
|
=, rpc:jstd
|
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
|
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
|
|
|
--
|
|
|
|
--
|