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.
Adds a new MIME part containing body to self
Uses "Content-Disposition: form-data", as per the HTML forms specification.
Passed: a <SoupMultipart>.
a multipart (presumably of type "multipart/form-data")
Passed: a string.
the name of the control associated with this file
Passed: a string, or #f.
the name of the file, or #f if not known
Passed: a string, or #f.
the MIME type of the file, or #f if not known
Passed: a <GBytes>.
the file data
Adds a new MIME part containing data to self.
Uses "Content-Disposition: form-data", as per the HTML forms specification.
Passed: a <SoupMultipart>.
a multipart (presumably of type "multipart/form-data")
Passed: a string.
the name of the control associated with data
Passed: a string.
the body data
Adds a new MIME part to self 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.)
Passed: a <SoupMultipart>.
Passed: a <SoupMessageHeaders>.
the MIME part headers
Passed: a <GBytes>.
the MIME part body
Frees self.
Passed: a <SoupMultipart>.
Gets the number of body parts in self.
Passed: a <SoupMultipart>.
Returned: a 32-bit integer.
the number of body parts in self
Gets the indicated body part from self.
Passed: a <SoupMultipart>.
Passed: a 32-bit integer.
the part number to get (counting from 0)
Returned: a boolean.
#t on success, #f if part is out of range (in which
case headers and body won’t be set)
Returned: a <SoupMessageHeaders>.
return location for the MIME part headers
Returned: a <GBytes>.
return location for the MIME part body
Creates a new empty Multipart with a randomly-generated boundary
string.
Note that mime-type must be the full MIME type, including "multipart/".
See also: Message.new_from_multipart.
Passed: a string.
the MIME type of the multipart to create.
Returned: a <SoupMultipart>.
a new empty <SoupMultipart> of the given
mime-type
Parses headers and body to form a new Multipart
Passed: a <SoupMessageHeaders>.
the headers of the HTTP message to parse
Passed: a <GBytes>.
the body of the HTTP message to parse
Returned: a <SoupMultipart>, or #f.
a new <SoupMultipart> (or #f if the
message couldn’t be parsed or wasn’t multipart).
Serializes self to dest-headers and dest-body.
Passed: a <SoupMultipart>.
Passed: a <SoupMessageHeaders>.
the headers of the HTTP message to serialize self to
Returned: a <GBytes>.
the body of the HTTP message to serialize self to