Multipart
Object Hierarchy:
Description:
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.
Namespace: Soup
Package: libsoup-2.4
Content:
Creation methods:
Methods:
-
public void append_form_file (string control_name, string filename, string content_type, Buffer body)
Adds a new MIME part containing body to multipart, using "Content-Disposition:
form-data", as per the HTML forms specification. See
request_new_from_multipart for more details.
-
public void append_form_string (string control_name, string data)
Adds a new MIME part containing data to multipart, using "Content-Disposition:
form-data", as per the HTML forms specification. See
request_new_from_multipart for more details.
-
public void append_part (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.)
-
public void free ()
Frees multipart
-
public int get_length ()
Gets the number of body parts in multipart
-
public bool get_part (int part, out MessageHeaders headers, out Buffer body)
Gets the indicated body part from multipart.
-
public void to_message (MessageHeaders dest_headers, MessageBody dest_body)
Serializes multipart to dest_headers and dest_body.