std.http.Client: add note about resource management

This commit is contained in:
Jan Weidner 2023-09-25 11:17:11 +02:00 committed by GitHub
parent eb072fa528
commit c8ba5839f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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