PDF data.
static let pdf: HTTPMediaType
PDF data.
static let pdf: HTTPMediaType
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
struct HTTPMediaType
Represents an encoded data-format, used in HTTP, HTML, email, and elsewhere.
init(type: String, subType: String, parameters: [String : String] = [:])
Create a new MediaType
.
static let any: HTTPMediaType
Any media type (/).
static let audio: HTTPMediaType
Basic audio.
static let avi: HTTPMediaType
AVI video.
static let avif: HTTPMediaType
AVIF image.
static let binary: HTTPMediaType
Binary data.
static let bzip2: HTTPMediaType
Bzip2 file.
static let css: HTTPMediaType
CSS media type.
static let dtd: HTTPMediaType
DTD media type.
static let formData: HTTPMediaType
Multipart encoded form data.
static let gif: HTTPMediaType
GIF image.
static let gzip: HTTPMediaType
Gzip file.
static let html: HTTPMediaType
HTML media type.
static let jpeg: HTTPMediaType
JPEG image.
static let json: HTTPMediaType
JSON media type.
static let jsonAPI: HTTPMediaType
JSON API media type.
static let jsonSequence: HTTPMediaType
JSON sequence media type.
static let jxl: HTTPMediaType
JPEG XL image.
static let midi: HTTPMediaType
MIDI audio.
static let mp3: HTTPMediaType
MP3 audio.
static let mpeg: HTTPMediaType
MPEG video.
static let multipart: HTTPMediaType
Mixed multipart encoded data.
static let ogg: HTTPMediaType
OGG audio.
static let plainText: HTTPMediaType
Plain text media type.
static let png: HTTPMediaType
PNG image.
static let svg: HTTPMediaType
SVG image.
static let tar: HTTPMediaType
tar file.
static let tiff: HTTPMediaType
TIFF image.
static let urlEncodedForm: HTTPMediaType
URL encoded form media type.
static let wave: HTTPMediaType
Wave audio.
static let webp: HTTPMediaType
WebP image.
static let xml: HTTPMediaType
XML media type.
static let zip: HTTPMediaType
Zip file.
static func fileExtension(_ ext: String) -> HTTPMediaType?
Creates a MediaType
from a file extension, if possible.
static func formData(boundary: String) -> HTTPMediaType
var description: String { get }
See CustomStringConvertible
.
var parameters: [String : String]
The MediaType
’s metadata. Zero or more key/value pairs.
var subType: String
The MediaType
’s specific type. Usually a unique string.
var type: String
The MediaType
’s discrete or composite type. Usually one of the following.
static func == (lhs: HTTPMediaType, rhs: HTTPMediaType) -> Bool
See Equatable
.
func hash(into hasher: inout Hasher)
See Hashable
.
func serialize() -> String
Converts this MediaType
into its string representation.