1
Fork 0
hare-http/cmd/http/main.ha

22 lines
421 B
Hare
Raw Normal View History

2023-02-09 19:54:21 +00:00
use net::http;
use net::ip;
use net::uri;
use os;
export fn main() void = {
const req = &http::request {
method = http::GET,
target = &uri::uri {
scheme = "http",
host = ip::LOCAL_V6,
path = "/",
...
},
body = void,
...
};
http::add_header(&req.header, "User-Agent", "Hare test client");
http::add_header(&req.header, "Content-Length", "100");
http::write_header(os::stdout, &req.header)!;
};