Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Instance Method

writePart(_:)

Writes a complete multipart part including boundary, headers, and body.
mutating func writePart(_ part: MultipartPart<some MultipartPartBodyElement>) async throws(Failure)

Parameters

part

The multipart part to write.

Discussion

The boundary and header block are built into a single buffer so the part takes three write(bytes:) calls in total: the framing prefix, the body, and the trailing CRLF.

Throws

The writer’s Failure.