applicationWasm
WebAssembly
static var applicationWasm: Self { get }
WebAssembly
static var applicationWasm: Self { get }
import Hummingbird
struct MediaType
Define media type of file
init?(from header: String)
Construct MediaType
from header value
init(type: Category, subType: String = "*", parameter: (String, String)? = nil)
Initialize MediaType
static var application: Self { get }
static var application7z: Self { get }
7-zip archive
static var applicationAbiWord: Self { get }
AbiWord document
static var applicationAmzKindleEBook: Self { get }
Amazon Kindle eBook format
static var applicationArc: Self { get }
Archive document (multiple files embedded)
static var applicationBinary: Self { get }
Any kind of binary data
static var applicationBzip: Self { get }
BZip archive
static var applicationBzip2: Self { get }
BZip2 archive
static var applicationCsh: Self { get }
C-Shell script
static var applicationDocx: Self { get }
Microsoft Word (OpenXML)
static var applicationEot: Self { get }
MS Embedded OpenType fonts
static var applicationEpub: Self { get }
Electronic publication (EPUB)
static var applicationGzip: Self { get }
GZip Compressed Archive
static var applicationJar: Self { get }
Java Archive (JAR)
static var applicationJson: Self { get }
JSON format
static var applicationJsonLD: Self { get }
JSON-LD format
static var applicationManifest: Self { get }
Manifest
static var applicationMpkg: Self { get }
Apple Installer Package
static var applicationMsword: Self { get }
Microsoft Word
static var applicationOdp: Self { get }
OpenDocument presentation document
static var applicationOds: Self { get }
OpenDocument spreadsheet document
static var applicationOdt: Self { get }
OpenDocument text document
static var applicationOgg: Self { get }
OGG
static var applicationPdf: Self { get }
Adobe Portable Document Format
static var applicationPhp: Self { get }
Hypertext Preprocessor
static var applicationPpt: Self { get }
Microsoft PowerPoint
static var applicationPptx: Self { get }
Microsoft PowerPoint (OpenXML)
static var applicationRar: Self { get }
RAR archive
static var applicationRtf: Self { get }
Rich Text Format (RTF)
static var applicationSh: Self { get }
Bourne shell script
static var applicationSwf: Self { get }
Small web format (SWF) or Adobe Flash document
static var applicationTar: Self { get }
Tape Archive (TAR)
static var applicationUrlEncoded: Self { get }
URL encoded form data
static var applicationVsd: Self { get }
Microsoft Visio
static var applicationXhtml: Self { get }
XHTML
static var applicationXls: Self { get }
Microsoft Excel
static var applicationXlsx: Self { get }
Microsoft Excel (OpenXML)
static var applicationXml: Self { get }
XML
static var applicationZip: Self { get }
ZIP archive
static var audio: Self { get }
static var audio3g2: Self { get }
3GPP2 audio/video container
static var audio3gp: Self { get }
3GPP audio/video container
static var audioAac: Self { get }
AAC audio
static var audioMidi: Self { get }
Musical Instrument Digital Interface (MIDI)
static var audioMpeg: Self { get }
MP3 audio
static var audioOgg: Self { get }
OGG audio
static var audioOpus: Self { get }
Opus audio
static var audioWave: Self { get }
Waveform Audio Format
static var audioWebm: Self { get }
WEBM audio
static var example: Self { get }
static var font: Self { get }
static var fontOtf: Self { get }
OpenType font
static var fontTtf: Self { get }
TrueType Font
static var fontWoff: Self { get }
Web Open Font Format (WOFF)
static var fontWoff2: Self { get }
Web Open Font Format (WOFF)
static var image: Self { get }
static var imageBmp: Self { get }
Windows OS/2 Bitmap Graphics
static var imageGif: Self { get }
Graphics Interchange Format (GIF)
static var imageIco: Self { get }
Icon format
static var imageJpeg: Self { get }
JPEG images
static var imagePng: Self { get }
Portable Network Graphics
static var imageSvg: Self { get }
Scalable Vector Graphics (SVG)
static var imageTiff: Self { get }
Tagged Image File Format (TIFF)
static var imageWebp: Self { get }
WEBP image
static var message: Self { get }
static var model: Self { get }
static var multipart: Self { get }
static var multipartForm: Self { get }
Multipart formdata
static var text: Self { get }
static var textCss: Self { get }
Cascading Style Sheets (CSS)
static var textCsv: Self { get }
Comma-separated values (CSV)
static var textHtml: Self { get }
HyperText Markup Language (HTML)
static var textICalendar: Self { get }
iCalendar format
static var textJavascript: Self { get }
JavaScript
static var textPlain: Self { get }
Text, (generally ASCII or ISO 8859-n)
static var video: Self { get }
static var video3g2: Self { get }
3GPP2 audio/video container
static var video3gp: Self { get }
3GPP audio/video container
static var videoMp4: Self { get }
AVI: Audio Video Interleave
static var videoMpeg: Self { get }
MPEG Video
static var videoOgg: Self { get }
OGG video
static var videoTs: Self { get }
MPEG transport stream
static var videoWebm: Self { get }
WEBM video
static func getMediaType(forExtension extension: FileExtension) -> MediaType?
Get media type from a file extension
static func getMediaType(forExtension extension: String) -> MediaType?
Get media type from a file extension
var description: String { get }
Output
let parameter: (name: String, value: String)?
optional parameter
let subType: String
exact kind of data specified
let type: Category
general category
static func ~= (lhs: Self, rhs: Self) -> Bool
func isType(_ type: MediaType) -> Bool
Return if media type matches the input
func withParameter(name: String, value: String) -> MediaType
Return media type with new parameter
struct Category
Media type categories
struct FileExtension
Type safe wrapper for file extensions. Additionally provides case insensitive comparison.