authorgravatar for jw3126@gmail.comJan Weidner <jw3126@gmail.com> 2023-09-25 11:17:11+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-09-25 12:17:11+03:00
logc8ba5839f717f80afc66c8d79b930e6474229086
treeb3b30d25f769fb95c519b5c71474f44f6d21e52a
parenteb072fa52846c6583b856c8c88d50d65f46b3667
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

std.http.Client: add note about resource management


1 files changed, 1 insertions(+), 0 deletions(-)

lib/std/http/Client.zig+1
...@@ -1063,6 +1063,7 @@ pub const protocol_map = std.ComptimeStringMap(Connection.Protocol, .{...@@ -1063,6 +1063,7 @@ pub const protocol_map = std.ComptimeStringMap(Connection.Protocol, .{
1063/// `uri` must remain alive during the entire request.1063/// `uri` must remain alive during the entire request.
1064/// `headers` is cloned and may be freed after this function returns.1064/// `headers` is cloned and may be freed after this function returns.
1065///1065///
1066/// The caller is responsible for calling `deinit()` on the `Request`.
1066/// This function is threadsafe.1067/// This function is threadsafe.
1067pub fn request(client: *Client, method: http.Method, uri: Uri, headers: http.Headers, options: RequestOptions) RequestError!Request {1068pub fn request(client: *Client, method: http.Method, uri: Uri, headers: http.Headers, options: RequestOptions) RequestError!Request {
1068 const protocol = protocol_map.get(uri.scheme) orelse return error.UnsupportedUrlScheme;1069 const protocol = protocol_map.get(uri.scheme) orelse return error.UnsupportedUrlScheme;