Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
http-request ( request -- response data )
HTTP client
>
GET requests with the HTTP client
Prev:
<get-request> ( url -- request )
Next:
with-http-get ( url quot -- response )
Vocabulary
http.client
Inputs and outputs
request
a
request
response
a
response
data
a
sequence
Word description
Sends an HTTP request to an HTTP server, and reads the response.
Errors
Throws an error if the HTTP request fails.
Definition
USING:
accessors
io.encodings.string
kernel
make
;
IN:
http.client
:
http-request
( request -- response data )
[
[
%
]
with-http-request
]
B{
}
make
over
content-encoding>>
decode
check-response-with-body
;