1
Fork 0
hare-http/cmd/http/main.ha
2023-02-09 20:56:48 +01:00

22 lines
421 B
Hare

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)!;
};