pub const FetchOptions = struct redirect_buffer: ?[]u8 = nullnull means it will be heap-allocated. RFC 9110 recommends at least 8000 bytes.
decompress_buffer: ?[]u8 = nullnull means it will be heap-allocated.
redirect_behavior: ?Request.RedirectBehavior = nullresponse_writer: ?*Writer = nullIf the server sends a body, it will be written here.
location: Locationmethod: ?http.Method = nullpayload: ?[]const u8 = nullraw_uri: bool = falsekeep_alive: bool = trueheaders: 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.
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791pub const FetchOptions = struct {
/// `null` means it will be heap-allocated. RFC 9110 recommends at least
/// 8000 bytes.
redirect_buffer: ?[]u8 = null,
/// `null` means it will be heap-allocated.
decompress_buffer: ?[]u8 = null,
redirect_behavior: ?Request.RedirectBehavior = null,
/// If the server sends a body, it will be written here.
response_writer: ?*Writer = null,
location: Location,
method: ?http.Method = null,
payload: ?[]const u8 = null,
raw_uri: bool = false,
keep_alive: bool = true,
/// 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 = &.{},
pub const Location = union(enum) {
url: []const u8,
uri: Uri,
};
}