Skip to content

Commit ebceb45

Browse files
committed
fix: adjust HTTP GET and to-file example
1 parent 32e8786 commit ebceb45

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/examples/networking/http-client.zig

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@ pub fn main() !void {
1313
try body.ensureUnusedCapacity(1024);
1414

1515
_ = try client.fetch(.{
16-
.location = .{ .url = "https://adventofcode.com/2023/day/6/input" },
17-
.extra_headers = &.{
18-
.{
19-
.name = "cookie",
20-
.value = "***REMOVED***",
21-
},
22-
},
16+
.location = .{ .url = "https://echo.free.beeceptor.com" },
17+
.extra_headers = &.{},
2318
.method = .GET,
2419
.response_writer = &body.writer,
2520
});

src/examples/networking/http-to-file.zig

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,14 @@ pub fn main() !void {
88
.allocator = allocator,
99
};
1010

11-
var body_file = try std.fs.cwd().createFile("aoc", .{});
11+
var body_file = try std.fs.cwd().createFile("http-response", .{});
1212
defer body_file.close();
1313
var buffer: [1]u8 = undefined;
1414
var body_writer = body_file.writerStreaming(&buffer);
1515

1616
_ = try client.fetch(.{
17-
.location = .{ .url = "https://adventofcode.com/2023/day/6/input" },
18-
.extra_headers = &.{
19-
.{
20-
.name = "cookie",
21-
.value = "***REMOVED***",
22-
},
23-
},
17+
.location = .{ .url = "https://echo.free.beeceptor.com" },
18+
.extra_headers = &.{},
2419
.method = .GET,
2520
.response_writer = &body_writer.interface,
2621
});

0 commit comments

Comments
 (0)