Handbook
Glossary
do-http-request ( request quot: ( chunk -- ) -- response/stream )
Vocabulary
http
.
client
Inputs
request
an
object
quot
a
quotation
with stack effect
( chunk -- )
Outputs
response/stream
an
object
Definition
USING:
accessors
destructors
http
http.client.private
io
kernel
math
namespaces
;
IN:
http.client
:
do-http-request
( request quot: ( chunk -- ) -- response/stream )
[
?default-proxy
\
request
]
dip
dup
[
[
[
request-socket
get
dispose
prepare-redirect
]
]
dip
[
do-http-request
]
curry
compose
]
dip
[
]
curry
[
dip
[
read-response-body
]
keep
request-socket
get
dispose
]
curry
[
[
dup
upgrade-to-websocket?
[
drop
request-socket
get
]
]
]
dip
[
if
]
curry
compose
[
[
[
read-response
dup
redirect?
request
get
redirects>>
0
>
and
]
]
dip
]
dip
[
if
]
2curry
compose
[
[
in>>
]
]
dip
[
with-input-stream*
]
curry
compose
[
[
<request-socket>
|dispose
dup
request-socket
set
[
[
in>>
]
[
out>>
]
bi
[
?https-tunnel
]
with-streams*
]
[
out>>
[
request
get
write-request
]
with-output-stream*
]
]
]
dip
[
tri
]
curry
compose
[
with-destructors
]
curry
with-variable
;
inline
recursive