struct RequestOptions [src]
Fields
version: http.Version = .@"HTTP/1.1"
handle_continue: bool = trueAutomatically ignore 100 Continue responses. This assumes you don't
care, and will have sent the body before you wait for the response.
If this is not the case AND you know the server will send a 100
Continue, set this to false and wait for a response before sending the
body. If you wait AND the server does not send a 100 Continue before
you finish the request, then the request will deadlock.
keep_alive: bool = trueIf false, close the connection after the one request. If true,
participate in the client connection pool.
redirect_behavior: Request.RedirectBehavior = @enumFromInt(3)This field specifies whether to automatically follow redirects, and if
so, how many redirects to follow before returning an error.
This will only follow redirects for repeatable requests (ie. with no
payload or the server has acknowledged the payload).
server_header_buffer: []u8Externally-owned memory used to store the server's entire HTTP header.
error.HttpHeadersOversize is returned from read() when a
client sends too many bytes of HTTP headers.
connection: ?*Connection = nullMust be an already acquired connection.
headers: Request.Headers = .{}Standard headers that have default, but overridable, behavior.
extra_headers: []const http.Header = &.{}These headers are kept including when following a redirect to a
different domain.
Externally-owned; must outlive the Request.
privileged_headers: []const http.Header = &.{}These headers are stripped when following a redirect to a different
domain.
Externally-owned; must outlive the Request.
Source
pub const RequestOptions = struct {
version: http.Version = .@"HTTP/1.1",
/// Automatically ignore 100 Continue responses. This assumes you don't
/// care, and will have sent the body before you wait for the response.
///
/// If this is not the case AND you know the server will send a 100
/// Continue, set this to false and wait for a response before sending the
/// body. If you wait AND the server does not send a 100 Continue before
/// you finish the request, then the request *will* deadlock.
handle_continue: bool = true,
/// If false, close the connection after the one request. If true,
/// participate in the client connection pool.
keep_alive: bool = true,
/// This field specifies whether to automatically follow redirects, and if
/// so, how many redirects to follow before returning an error.
///
/// This will only follow redirects for repeatable requests (ie. with no
/// payload or the server has acknowledged the payload).
redirect_behavior: Request.RedirectBehavior = @enumFromInt(3),
/// Externally-owned memory used to store the server's entire HTTP header.
/// `error.HttpHeadersOversize` is returned from read() when a
/// client sends too many bytes of HTTP headers.
server_header_buffer: []u8,
/// Must be an already acquired connection.
connection: ?*Connection = null,
/// Standard headers that have default, but overridable, behavior.
headers: Request.Headers = .{},
/// These headers are kept including when following a redirect to a
/// different domain.
/// Externally-owned; must outlive the Request.
extra_headers: []const http.Header = &.{},
/// These headers are stripped when following a redirect to a different
/// domain.
/// Externally-owned; must outlive the Request.
privileged_headers: []const http.Header = &.{},
}