Instance Method
serialize(parts:boundary:into:)
Serializes the
MultipartForm into a ByteBuffer.func serialize(parts: [MultipartPart], boundary: String, into buffer: inout ByteBuffer) throws
Parameters
partsOne or more
MultipartParts to serialize intoData.boundaryMultipart boundary to use for encoding. This must not appear anywhere in the encoded data.
bufferBuffer to write to.
Discussion
var buffer = ByteBuffer()
try MultipartSerializer().serialize(parts: [part], boundary: "123", into: &buffer)
print(String(buffer: buffer)) // multipart-encoded
Throws
Any errors that may occur during serialization.