HTTPMediaType
public struct HTTPMediaType
extension HTTPMediaType: Equatable
extension HTTPMediaType: CustomStringConvertible
Describes media types for the Content-Type
HTTP header.
Also contains a number of default media types, defined according to: https://tools.ietf.org/html/rfc2045#section-5
-
The identifier corresponding to
See moretype
portion of a HTTP media typeString
.Declaration
Swift
public enum TypeIdentifier : String
-
Initializes a
HTTPMediaType
based on various required and optional components.Declaration
Swift
public init(type: TypeIdentifier, subType: String, parameters: [String: String]? = nil)
Parameters
type
The
TypeIdentifier
of the HTTP media type.subType
The subtype
String
of the HTTP media type.parameters
An optional
Dictionary
of additional parameters.
-
The
String
representation of the receiver.Declaration
Swift
public func toString() -> String
Return Value
A
String
representation suitable for use as aHTTPHeader
value string.
-
Undocumented
Declaration
Swift
static let utf8CharsetParameter: [String : String]
-
Undocumented
Declaration
Swift
static let any: HTTPMediaType
-
Undocumented
Declaration
Swift
static let binary: HTTPMediaType
-
Undocumented
Declaration
Swift
static let bzip2: HTTPMediaType
-
Undocumented
Declaration
Swift
static let gzip: HTTPMediaType
-
Undocumented
Declaration
Swift
static let dtd: HTTPMediaType
-
Undocumented
Declaration
Swift
static let json: HTTPMediaType
-
Undocumented
Declaration
Swift
static let jsonAPI: HTTPMediaType
-
Undocumented
Declaration
Swift
static let pdf: HTTPMediaType
-
Undocumented
Declaration
Swift
static let tar: HTTPMediaType
-
Undocumented
Declaration
Swift
static let urlEncodedForm: HTTPMediaType
-
Undocumented
Declaration
Swift
static let xml: HTTPMediaType
-
Undocumented
Declaration
Swift
static let zip: HTTPMediaType
-
Undocumented
Declaration
Swift
static let audio: HTTPMediaType
-
Undocumented
Declaration
Swift
static let midi: HTTPMediaType
-
Undocumented
Declaration
Swift
static let mp3: HTTPMediaType
-
Undocumented
Declaration
Swift
static let wav: HTTPMediaType
-
Undocumented
Declaration
Swift
static let ogg: HTTPMediaType
-
Undocumented
Declaration
Swift
static let gif: HTTPMediaType
-
Undocumented
Declaration
Swift
static let jpeg: HTTPMediaType
-
Undocumented
Declaration
Swift
static let png: HTTPMediaType
-
Undocumented
Declaration
Swift
static let svg: HTTPMediaType
-
Undocumented
Declaration
Swift
static let multipartFormData: HTTPMediaType
-
Undocumented
Declaration
Swift
static func multipartFormData(boundary: String) -> HTTPMediaType
-
Undocumented
Declaration
Swift
static let css: HTTPMediaType
-
Undocumented
Declaration
Swift
static let html: HTTPMediaType
-
Undocumented
Declaration
Swift
static let plainText: HTTPMediaType
-
Undocumented
Declaration
Swift
static let avi: HTTPMediaType
-
Undocumented
Declaration
Swift
static let mpeg: HTTPMediaType
-
Returns a Boolean value indicating whether two
HTTPMediaType
values are equal.Declaration
Swift
public static func == (lhs: `Self`, rhs: `Self`) -> Bool
Parameters
lhs
A value to compare.
rhs
Another value to compare.
Return Value
true
if the two media types are considered equal, andfalse
otherwise.
-
A string description of the
HTTPMediaType
.Declaration
Swift
public var description: String { get }