Module typeables::media_type
source · [−]Expand description
Media type
Example: The media type code “text/plain” means that content (e.g. a software file) is the media type supertype “text” (e.g. not an image, not a movie, etc.) and media type subtype “plain” (e.g. not hypertext, not markdown, etc.).
Examples of common media type codes:
-
text/plain is a typical note file
-
image/jpeg is a typical photo file
-
audio/ogg is a typical sound file
-
video/mpeg is a typical movie file
-
application/json is a typical data file
Media Type Code
Examples:
let x = MediaTypeCodeAsStructStr("text/plain");
let x = MediaTypeCodeAsStructStr("image/jpeg");
let x = MediaTypeCodeAsStructStr("audio/ogg");
let x = MediaTypeCodeAsStructStr("video/mpeg");
let x = MediaTypeCodeAsStructStr("application/json");
Media Type Supertype
Examples:
let x = MediaTypeSupertypeAsStructStr("text"); // e.g. "text/plain"
let x = MediaTypeSupertypeAsStructStr("image"); // e.g. "image/jpeg"
let x = MediaTypeSupertypeAsStructStr("audio"); // e.g. "audio/ogg"
let x = MediaTypeSupertypeAsStructStr("video"); // e.g. "video/mpeg"
let x = MediaTypeSupertypeAsStructStr("application"); // e.g. "application/json"
Media Type Subtype
Examples:
let x = MediaTypeSubtypeAsStructStr("plain"); // e.g. "text/plain"
let x = MediaTypeSubtypeAsStructStr("jpeg"); // e.g. "image/jpeg"
let x = MediaTypeSubtypeAsStructStr("ogg"); // e.g. "audio/ogg"
let x = MediaTypeSubtypeAsStructStr("mpeg"); // e.g. "video/mpeg"
let x = MediaTypeSubtypeAsStructStr("json"); // e.g. "application/json"
Media Type Suffix
Examples:
let x = MediaTypeSuffixAsStructStr("+json");
let x = MediaTypeSuffixAsStructStr("+zip");
Media Type Parameter
Examples:
let x = MediaTypeParameterAsStructStr("charset=UTF-8");
let x = MediaTypeParameterAsStructStr("charset=UTF-16");
let x = MediaTypeParameterAsStructStr("charset=ASCII");
let x = MediaTypeParameterAsStructStr("boundary=alpha");
let x = MediaTypeParameterAsStructStr("boundary=bravo");
let x = MediaTypeParameterAsStructStr("boundary=charlie");
Media Type Tree
Examples:
let x = MediaTypeTreeAsStructStr("x."); // x means unregistered
let x = MediaTypeTreeAsStructStr("vnd."); // vnd means vendor