Multipart
public enum Multipart
extension Multipart: CustomStringConvertible
extension Multipart: RawRepresentable
extension Multipart: MediaSubtype
extension Multipart: Hashable
Represents the multipart media type. See the
official documentation for details.
You typically use Multipart as a MediaType.
let multipart = Multipart.formData()
let mediaType = MediaType.multipart(multipart) // Creates: multipart/form-data
You can use standard switch statement to access multipart values.
func isSupported(multipart: Multipart) -> Bool {
switch multipart {
case .formData, .mixed: return true
default: return false
}
}
isSupported(audio: .formData()) // Returns: true
isSupported(audio: .mixed()) // Returns: true
isSupported(audio: .voiceMessage()) // Returns: false
See also
MediaType
-
Represents the
alternativesubtype.Declaration
Swift
case alternative(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
appledoublesubtype.Declaration
Swift
case appledouble(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
byterangessubtype.Declaration
Swift
case byteranges(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
digestsubtype.Declaration
Swift
case digest(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
encryptedsubtype.Declaration
Swift
case encrypted(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
examplesubtype.Declaration
Swift
case example(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
form-datasubtype.Declaration
Swift
case formData(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
header-setsubtype.Declaration
Swift
case headerSet(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
mixedsubtype.Declaration
Swift
case mixed(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
multilingualsubtype.Declaration
Swift
case multilingual(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
parallelsubtype.Declaration
Swift
case parallel(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
relatedsubtype.Declaration
Swift
case related(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
reportsubtype.Declaration
Swift
case report(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
signedsubtype.Declaration
Swift
case signed(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
voice-messagesubtype.Declaration
Swift
case voiceMessage(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
x-mixed-replacesubtype.Declaration
Swift
case xMixedReplace(_: Suffix? = nil, _: Parameters? = nil) -
Represents a subtype that does not fit in the other cases or is currently not officially defined.
You can use this case to define an arbitrary, unregistered subtype with the given name or to represent a subtype in the non standard tree, e.g. vendor tree or personal tree.
Optionally, you can specify a
SuffixandParameters.Declaration
Swift
case other(String, _: Suffix? = nil, _: Parameters? = nil) -
Declaration
Swift
case anything(_: Suffix? = nil, _: Parameters? = nil) -
Declaration
Swift
public var description: String { get } -
Declaration
Swift
public init(rawValue: String) -
Declaration
Swift
public var rawValue: String { get } -
Declaration
Swift
public var type: MediaType { get } -
Declaration
Swift
public static func == (lhs: `Self`, rhs: `Self`) -> Bool -
Declaration
Swift
public func hash(into hasher: inout Hasher)