blob: e87651132f2cacbaab993af5bf775516a3225ca1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/- spider
/+ strandio
=, strand=strand:spider
=, dejs-soft:format
=, strand-fail=strand-fail:libstrand:spider
^- thread:spider
|= arg=vase
=/ request ;;(request:http q.arg)
=/ m (strand ,vase) ^- form:m
:: =/ m (strand ,json) ^- form:m
;< ~ bind:m (send-request:strandio request)
;< res=client-response:iris bind:m take-client-response:strandio
?. ?=(%finished -.res) (strand-fail:strand %no-body ~)
:: =/ headers headers.response-header.res
:: =/ redirect (get-header:http 'location' headers)
:: ?^ redirect (pure:m [%| u.redirect])
::
?~ full-file.res (strand-fail:strand %no-body ~)
=/ body=@t q.data.u.full-file.res
(pure:m !>(body))
|