:sig
function http_request(request : dval) dval

:params
request : a map that describes an outbound request

:returns
A map with `status`, `headers`, `body`, and `error`.

:content
`http_request()` sends an outbound HTTP or HTTPS request. Set `method`, `url`, `headers`, `body`, `timeout_ms`, and `follow_redirects` as needed.

When you set a `security` field, set `https_only`, `public_dns_only`, `pin_dns`, `isolated_curl`, and `no_redirects` to `true`.

:errors
The result can report `invalid_request`, `unsafe_dns`, `timeout`, `response_too_large`, `redirect_not_allowed`, `http_status`, or `network_failure`.

:example capy cli
var outbound := dval({"method": "GET", "url": "http://127.0.0.1/tests/capy-render.capy", "headers": {"Host": "bearer.openfu.com"}, "timeout_ms": 2000})
var response := http_request(outbound)
print("status=", s32(response["status"]), "\n")

:see-group
http-client
