1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 15:14:08 +00:00

fix test-httpparams (std.http use)

This commit is contained in:
Rene Schallner 2024-04-21 16:22:51 +02:00
parent 90c544d69a
commit 0e43f565ec

View file

@ -2,19 +2,13 @@ const std = @import("std");
const zap = @import("zap");
fn makeRequest(a: std.mem.Allocator, url: []const u8) !void {
const uri = try std.Uri.parse(url);
var h = std.http.Headers{ .allocator = a };
defer h.deinit();
var http_client: std.http.Client = .{ .allocator = a };
defer http_client.deinit();
var req = try http_client.open(.GET, uri, h, .{});
defer req.deinit();
_ = try http_client.fetch(.{
.location = .{ .url = url },
});
try req.send(.{});
try req.wait();
zap.stop();
}