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

18 lines
329 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 = {
2023-02-09 22:23:05 +00:00
const client = http::newclient("Hare test client");
defer http::client_finish(&client);
const req = http::get(&client, &uri::uri {
scheme = "http",
host = ip::LOCAL_V6,
path = "/",
2023-02-09 19:54:21 +00:00
...
2023-02-09 22:23:05 +00:00
});
2023-02-09 19:54:21 +00:00
http::write_header(os::stdout, &req.header)!;
};