1
Fork 0
hare-http/net/http/response.ha

24 lines
575 B
Hare
Raw Normal View History

2023-02-10 09:13:30 +00:00
use io;
use os;
2023-02-10 09:13:30 +00:00
// Stores state related to an HTTP response.
export type response = struct {
// HTTP protocol version (major, minor)
version: (uint, uint),
2023-02-10 09:13:30 +00:00
// The HTTP status for this request as an integer.
status: uint,
// The HTTP status reason phrase.
reason: str,
// The HTTP headers provided by the server.
header: header,
// The response body, if any.
body: nullable *io::stream,
2023-02-10 09:13:30 +00:00
};
// Frees state associated with an HTTP [[response]].
export fn response_finish(resp: *response) void = {
header_free(&resp.header);
free(resp.reason);
free(resp.body);
2023-02-10 09:13:30 +00:00
};