spork/http/request
spork
function
/usr/local/lib/janet/spork/http.janet on line 478, column 1
(request method url &keys {:headers headers :stream-opts stream-opts :body body :stream-factory stream-factory})
Make an HTTP request to a server. Returns a table containing
response information.
* `:head-size` - number of bytes in the http header
* `:headers` - table mapping header names to header values. Header
names are lowercase.
* `:connection` - the connection stream for the header.
* `:buffer` - the buffer instance that may contain extra bytes.
* `:status` - HTTP status code as an integer.
* `:message` - HTTP status message.
* `:body` - Bytes of the response body.
Options:
* `:body` - Request body content
* `:headers` - Request headers table
* `:stream-factory` - Function to create connection stream.
Defaults to net/connect. Signature: (stream-factory host port
stream-opts)
* `:stream-opts` - Options table passed to stream-factory