BodyPart
public struct BodyPart
Object encapsulating a singular part of a multipart form.
-
Initialize a
BodyPartinstance.Declaration
Swift
public init?(key: String, value: Any)Parameters
keyThe body part identifier.
valueThe value of the
BodyPart. -
Initialize a
BodyPartinstance.Declaration
Swift
public init(key: String, data: Data, mimeType: String? = nil, fileName: String? = nil)Parameters
keyThe body part identifier.
dataThe data of the BodyPart.
mimeTypeThe MIME type.
fileTypeThe data’s file name.
-
Construct the content of the
BodyPart.Declaration
Swift
public func content() throws -> DataReturn Value
Returns a
Dataobject consisting of the header and data.
View on GitHub
BodyPart Structure Reference