1
Fork 0
hare-http/net/http/response.ha
Drew DeVault 946c985a02 Rig out transport handling, finish identity reader
New patch will implement more transports, such as chunked and gzip.
2023-02-11 11:31:07 +01:00

24 lines
575 B
Hare

use io;
use os;
// Stores state related to an HTTP response.
export type response = struct {
// HTTP protocol version (major, minor)
version: (uint, uint),
// 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,
};
// Frees state associated with an HTTP [[response]].
export fn response_finish(resp: *response) void = {
header_free(&resp.header);
free(resp.reason);
free(resp.body);
};