Support MIME (HTTP Media Types) types parse in Zig.
var mime = Mime.parse(std.heap.page_allocator, "text/plain; charset=utf-8; foo=bar"); try std.testing.expect(mime != null); try std.testing.expect(std.mem.eql(u8, mime.?.essence, "text/plain; charset=utf-8; foo=bar")); try std.testing.expect(std.mem.eql(u8, mime.?.basetype, "text")); try std.testing.expect(std.mem.eql(u8, mime.?.subtype, "plain")); const charset = mime.?.getParam("charset"); try testing.expectEqualStrings("utf-8", charset.?); const foo = mime.?.getParam("foo"); try testing.expectEqualStrings("bar", foo.?); const bar = mime.?.getParam("bar"); try testing.expect(bar == null);
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4