Bytes
Bytes format (application/octet-stream).
Just like the text format, the "bytes" format imports/exports binary (blob) data to/from a "bytes" field.
#[main]
fn main() {
const bytes: blob = "hello, world";
const object = new {};
parse(bytes, object, format = "bytes");
assert_eq(typeof object.bytes, "blob");
assert_eq(object.bytes as str, "hello, world");
const export = blobify("bytes", object);
assert_eq(export as str, "hello, world");
}Last updated
Was this helpful?