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:
parent
90c544d69a
commit
0e43f565ec
1 changed files with 3 additions and 9 deletions
|
@ -2,19 +2,13 @@ const std = @import("std");
|
||||||
const zap = @import("zap");
|
const zap = @import("zap");
|
||||||
|
|
||||||
fn makeRequest(a: std.mem.Allocator, url: []const u8) !void {
|
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 };
|
var http_client: std.http.Client = .{ .allocator = a };
|
||||||
defer http_client.deinit();
|
defer http_client.deinit();
|
||||||
|
|
||||||
var req = try http_client.open(.GET, uri, h, .{});
|
_ = try http_client.fetch(.{
|
||||||
defer req.deinit();
|
.location = .{ .url = url },
|
||||||
|
});
|
||||||
|
|
||||||
try req.send(.{});
|
|
||||||
try req.wait();
|
|
||||||
zap.stop();
|
zap.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue