Multipart

Represents a multipart HTTP message body, parsed according to the syntax of RFC 2046. Of particular interest to HTTP are <literal>multipart/byte-ranges</literal> and <literal>multipart/form-data</literal>.

Although the headers of a #SoupMultipart 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 #SoupMultipart for handling real MIME multiparts.

Constructors

this
this(SoupMultipart* soupMultipart, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string mimeType)

Creates a new empty #SoupMultipart with a randomly-generated boundary string. Note that @mime_type must be the full MIME type, including "multipart/".

this
this(MessageHeaders headers, MessageBody body_)

Parses @headers and @body to form a new #SoupMultipart

Destructor

~this
~this()
Undocumented in source.

Members

Functions

appendFormFile
void appendFormFile(string controlName, string filename, string contentType, Buffer body_)

Adds a new MIME part containing @body to @multipart, using "Content-Disposition: form-data", as per the HTML forms specification. See soup_form_request_new_from_multipart() for more details.

appendFormString
void appendFormString(string controlName, string data)

Adds a new MIME part containing @data to @multipart, using "Content-Disposition: form-data", as per the HTML forms specification. See soup_form_request_new_from_multipart() for more details.

appendPart
void appendPart(MessageHeaders headers, Buffer body_)

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.)

free
void free()

Frees @multipart

getLength
int getLength()

Gets the number of body parts in @multipart

getMultipartStruct
SoupMultipart* getMultipartStruct(bool transferOwnership)

Get the main Gtk struct

getPart
bool getPart(int part, MessageHeaders headers, Buffer body_)

Gets the indicated body part from @multipart.

getStruct
void* getStruct()

the main Gtk struct as a void*

toMessage
void toMessage(MessageHeaders destHeaders, MessageBody destBody)

Serializes @multipart to @dest_headers and @dest_body.

Static functions

getType
GType getType()

Variables

ownedRef
bool ownedRef;
Undocumented in source.
soupMultipart
SoupMultipart* soupMultipart;

the main Gtk struct

Meta

Since

2.26