diff --git a/net/http/transport.ha b/net/http/transport.ha index 44c1296..7318aad 100644 --- a/net/http/transport.ha +++ b/net/http/transport.ha @@ -6,6 +6,48 @@ use strconv; use strings; use types; +// Configures the transport mode. +// +// For clients, if set to "none", no transport decoding is performed on the +// response body, and the user must read the Transport-Encoding header and +// decode it themselves. If set to "auto", [[response]].body will be decoded +// according to the response's Transport-Encoding header. Most users will want +// this to be set to "auto". +// +// For servers, if set to "auto", net::http will examine the Transport-Encoding +// header and apply the appropriate transport encoding. If set to "none", the +// response body will be sent directly to the client with no further processing. +export type transport_mode = enum { + AUTO = 0, + NONE, +}; + +// Configures the content mode. +// +// For clients, if set to "none", no content decoding is performed on the +// response body, and the user must read the Content-Encoding header and decode +// it themselves. If set to "auto", [[response]].body will be decoded according +// to the response's Content-Encoding header. Most users will want this to be +// set to "auto". +// +// For servers, if set to "auto", net::http will examine the Content-Encoding +// header and apply the appropriate content encoding. If set to "none", the +// response body will be sent directly to the client with no further processing. +export type content_mode = enum { + AUTO = 0, + NONE, +}; + +// Describes an HTTP [[client]]'s transport configuration for a given request. +export type transport = struct { + // Desired Transport-Encoding configuration, see [[transport_mode]] for + // details. + transport: transport_mode, + // Desired Content-Encoding configuration, see [[content_mode]] for + // details. + content: content_mode, +}; + export fn new_reader( conn: io::handle, resp: *response,