22 lines
421 B
Hare
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)!;
|
||
|
};
|