From 5adf7d0e022d5859c7f6a71e25ca44fc275955a9 Mon Sep 17 00:00:00 2001 From: Rene Schallner Date: Tue, 12 Sep 2023 19:16:11 +0200 Subject: [PATCH] updated bindataformpost example --- examples/bindataformpost/bindataformpost.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/bindataformpost/bindataformpost.zig b/examples/bindataformpost/bindataformpost.zig index eced55c..6875f65 100644 --- a/examples/bindataformpost/bindataformpost.zig +++ b/examples/bindataformpost/bindataformpost.zig @@ -42,6 +42,13 @@ const Handler = struct { }, else => { // might be a string param, we don't care + // let's just get it as string + if (r.getParamStr(kv.key.str, Handler.alloc, false)) |maybe_str| { + const value: []const u8 = if (maybe_str) |s| s.str else "(no value)"; + std.log.debug(" {s} = {s}", .{ kv.key.str, value }); + } else |err| { + std.log.err("Error: {any}\n", .{err}); + } }, } }