Connecting and opening requests are threadsafe. Individual requests are not.

Fields

allocator: Allocator,
ca_bundle: std.crypto.Certificate.Bundle = .{ },
ca_bundle_mutex: std.Thread.Mutex = .{ },
next_https_rescan_certs: bool = true,

When this is true, the next time this client performs an HTTPS request, it will first rescan the system for root certificates.

connection_pool: ConnectionPool = .{ },

The pool of connections that can be reused (and currently in use).

proxy: ?HttpProxy = null,

Functions

fn connect(client: *Client, host: []const u8, port: u16, protocol: Connection.Protocol) ConnectError!*ConnectionPool.Node

No documentation provided.

fn connectUnproxied(client: *Client, host: []const u8, port: u16, protocol: Connection.Protocol) ConnectUnproxiedError!*ConnectionPool.Node

Connect to host:port using the specified protocol. This will reuse a connectio…

Connect to host:port using the specified protocol. This will reuse a connection if one is already open. This function is threadsafe.

fn deinit(client: *Client) void

Release all associated resources with the client. TODO: currently leaks all req…

Release all associated resources with the client. TODO: currently leaks all request allocated data

fn request(client: *Client, method: http.Method, uri: Uri, headers: http.Headers, options: Options) RequestError!Request

Form and send a http request to a server. This function is threadsafe.