diff --git a/net/http/client.ha b/net/http/client.ha index 93d91b3..069ee57 100644 --- a/net/http/client.ha +++ b/net/http/client.ha @@ -31,6 +31,11 @@ export fn client_default_header(client: *client) *header = { return &client.default_header; }; +// Returns the default [[transport]] configuration used by this HTTP client. +export fn client_default_transport(client: *client) *transport = { + return &client.default_transport; +}; + fn new_request(client: *client, method: str, target: *uri::uri) request = { let req = request { method = method, diff --git a/net/http/request.ha b/net/http/request.ha index eb536f8..a975299 100644 --- a/net/http/request.ha +++ b/net/http/request.ha @@ -15,6 +15,9 @@ export type request = struct { // List of HTTP request headers. header: header, + // Transport configuration, or null to use the [[client]] default. + transport: nullable *transport, + // I/O reader for the request body. body: (io::handle | void), };