mirror of
https://github.com/zigzap/zap.git
synced 2025-10-20 15:14:08 +00:00
0.15.1-fix bindataformpost example
This commit is contained in:
parent
8540828bf5
commit
e5c5e7d3cf
1 changed files with 5 additions and 5 deletions
|
@ -38,13 +38,13 @@ const Handler = struct {
|
|||
//
|
||||
// HERE WE HANDLE THE BINARY FILE
|
||||
//
|
||||
const params = try r.parametersToOwnedList(Handler.alloc);
|
||||
var params = try r.parametersToOwnedList(Handler.alloc);
|
||||
defer params.deinit();
|
||||
for (params.items) |kv| {
|
||||
if (kv.value) |v| {
|
||||
for (params.items) |*kv| {
|
||||
if (kv.value) |*v| {
|
||||
std.debug.print("\n", .{});
|
||||
std.log.info("Param `{s}` in owned list is {any}", .{ kv.key, v });
|
||||
switch (v) {
|
||||
switch (v.*) {
|
||||
// single-file upload
|
||||
zap.Request.HttpParam.Hash_Binfile => |*file| {
|
||||
const filename = file.filename orelse "(no filename)";
|
||||
|
@ -66,7 +66,7 @@ const Handler = struct {
|
|||
std.log.debug(" mimetype: {s}", .{mimetype});
|
||||
std.log.debug(" contents: {any}", .{data});
|
||||
}
|
||||
files.*.deinit();
|
||||
files.deinit(alloc);
|
||||
},
|
||||
else => {
|
||||
// let's just get it as its raw slice
|
||||
|
|
Loading…
Add table
Reference in a new issue