1
Fork 0

Fish transport config through various types

This commit is contained in:
Drew DeVault 2023-02-12 12:55:16 +01:00
parent c76599f71c
commit 5e205199dc
2 changed files with 8 additions and 0 deletions

View file

@ -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,

View file

@ -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),
};