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
alternative
subtype.Declaration
Swift
case alternative(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
appledouble
subtype.Declaration
Swift
case appledouble(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
byteranges
subtype.Declaration
Swift
case byteranges(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
digest
subtype.Declaration
Swift
case digest(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
encrypted
subtype.Declaration
Swift
case encrypted(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
example
subtype.Declaration
Swift
case example(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
form-data
subtype.Declaration
Swift
case formData(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
header-set
subtype.Declaration
Swift
case headerSet(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
mixed
subtype.Declaration
Swift
case mixed(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
multilingual
subtype.Declaration
Swift
case multilingual(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
parallel
subtype.Declaration
Swift
case parallel(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
related
subtype.Declaration
Swift
case related(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
report
subtype.Declaration
Swift
case report(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
signed
subtype.Declaration
Swift
case signed(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
voice-message
subtype.Declaration
Swift
case voiceMessage(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
x-mixed-replace
subtype.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
Suffix
andParameters
.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)