MultipartForm

public struct MultipartForm

Representation of a multipart form request body.

  • Initialize an empty form.

    Declaration

    Swift

    public init()
  • Append a body part to the form.

    Declaration

    Swift

    public mutating func appendPart(name: String, contents: Data)

    Parameters

    name

    The name of the part.

    contents

    The raw data to include in the body part.

  • Append a file body part to the form.

    Declaration

    Swift

    public mutating func appendFilePart(name: String, contents: InputStream, length: Int, fileName: String, mimeType: String)

    Parameters

    name

    The name of the part.

    contents

    A stream containing the file contents.

    length

    The number of bytes in the file.

    fileName

    The name of the file.

    mimeType

    The content type of the file.