简体   繁体   中英

MIME type for Flatbuffers?

I've searched to find the proper MIME type for flatbuffers but I can't seem to find any. No mention of it on their documentation either.

The project page: https://github.com/google/flatbuffers

There is a similar question for protocol buffers, with a useful answer here: https://stackoverflow.com/a/48051331/761177

For flatbuffers something like application/x-flatbuffers;schema=xyz might be appropriate, where xyz is the namespace declared in your schema.

There is none. The correct mime type to use is application/octet-stream .

I don't think creating one would make sense either, since a naked FlatBuffer (without knowledge of its schema) cannot be parsed (unlike JSON), it is an opaque binary file. application/flatbuffer (if it existed) is barely more useful than application/octet-stream .

You need the schema before the file becomes readable, and I don't think mime types have a way to specify the schema name.. though I suppose flatbuffers/schema-name would be cool, if whatever standards body governs mime types would allow it :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM