Class (GI Struct)

Soup-3.0SoupMultipart

Represents a multipart HTTP message body, parsed according to the syntax of RFC 2046.

Of particular interest to HTTP are multipart/byte-ranges and multipart/form-data,

Although the headers of a Multipart body part will contain the full headers from that body part, libsoup does not interpret them according to MIME rules. For example, each body part is assumed to have "binary" Content-Transfer-Encoding, even if its headers explicitly state otherwise. In other words, don't try to use Multipart for handling real MIME multiparts.

Index

Constructors

Properties

$gtype: GType<Multipart>

Methods

  • Adds a new MIME part containing body to multipart

    Uses "Content-Disposition: form-data", as per the HTML forms specification.

    Parameters

    • control_name: string

      the name of the control associated with this file

    • filename: string

      the name of the file, or null if not known

    • content_type: string

      the MIME type of the file, or null if not known

    • body: GLib.Bytes | Uint8Array<ArrayBufferLike>

      the file data

    Returns void

  • Adds a new MIME part containing data to multipart.

    Uses "Content-Disposition: form-data", as per the HTML forms specification.

    Parameters

    • control_name: string

      the name of the control associated with data

    • data: string

      the body data

    Returns void

  • Adds a new MIME part to multipart with the given headers and body.

    (The multipart will make its own copies of headers and body, so you should free your copies if you are not using them for anything else.)

    Parameters

    Returns void

  • Gets the number of body parts in multipart.

    Returns number

    the number of body parts in multipart