implements the MultiPartFormDataMessage class, a specialization of MultiPartMessage
More...
#include <Mime.qm.dox.h>
|
| addPart (data mime_data, string name, *hash hdr) |
| adds a message part to the end of the list
|
|
| addPart (data mime_data, string name, string filename, string content_type, *hash hdr) |
| adds a message part to the end of the list
|
|
| addPart (hash< FormDataMessageInfo > h) |
| adds a message part to the end of the list
|
|
| constructor (string boundary=MultiPartMessage::getBoundary()) |
| creates the object
|
|
hash< MessageInfo > | getMsgAndHeaders () |
| returns a hash of the message
|
|
| splicePart (data mime_data, string name, *hash hdr) |
| adds a message part to the start of the list
|
|
| splicePart (data mime_data, string name, string filename, string content_type, *hash hdr) |
| adds a message part to the start of the list
|
|
| splicePart (hash< FormDataMessageInfo > h) |
| adds a message part to the start of the list
|
|
| constructor (string mptype, string boundary=MultiPartMessage::getBoundary()) |
| creates the object
|
|
string | getBoundary () |
| returns the message boundary string used
|
|
abstract hash< MessageInfo > | getMsgAndHeaders () |
| returns a hash of the message
|
|
binary | serialize () |
| serializes the message with the Content-Type header first and returns a binary object ready to send over a socket
|
|
binary | serializeBody () |
| serializes the message body only and returns a binary object ready to send over a socket
|
|
int | size () |
| returns the number of parts in the message
|
|
|
| checkPartName (string name) |
| check for unique part names and adds the part to the unique name hash
|
|
hash | getPartHeader (string name, *string filename, *string content_type, *hash< auto > hdr) |
| builds the header for the part
|
|
|
hash | parts |
| hash of part names to ensure uniqueness
|
|
implements the MultiPartFormDataMessage class, a specialization of MultiPartMessage
- Since
- Mime 1.4
◆ addPart() [1/3]
Mime::MultiPartFormDataMessage::addPart |
( |
data |
mime_data, |
|
|
string |
name, |
|
|
*hash |
hdr |
|
) |
| |
adds a message part to the end of the list
- Parameters
-
mime_data | the data for the part |
name | the unique name for the part |
hdr | an optional hash of headers for the part |
- Exceptions
-
MULTIPART-FORMDATA-ERROR | the name parameter is empty or conflicts with an existing part name |
◆ addPart() [2/3]
Mime::MultiPartFormDataMessage::addPart |
( |
data |
mime_data, |
|
|
string |
name, |
|
|
string |
filename, |
|
|
string |
content_type, |
|
|
*hash |
hdr |
|
) |
| |
adds a message part to the end of the list
- Parameters
-
mime_data | the data for the part |
name | the unique name for the part |
filename | the filename for the part |
content_type | the content_type for the part |
hdr | an optional hash of headers for the part |
- Exceptions
-
MULTIPART-FORMDATA-ERROR | the name parameter is empty or conflicts with an existing part name; empty filename or content_type arguments |
◆ addPart() [3/3]
adds a message part to the end of the list
- Parameters
-
h | the information for this part |
- Exceptions
-
MULTIPART-FORMDATA-ERROR | the name parameter is empty or conflicts with an existing part name; empty filename or content_type arguments |
◆ constructor()
creates the object
- Parameters
-
boundary | the boundary to use between parts |
◆ getMsgAndHeaders()
hash< MessageInfo > Mime::MultiPartFormDataMessage::getMsgAndHeaders |
( |
| ) |
|
returns a hash of the message
- Returns
- a hash of the message with the following keys:
hdr:
a hash of header information
body:
a binary object of serialized message parts
◆ makeMessage()
creates a multipart/form-data message from a hash of FormDataMessageInfo hashes keyed by part name
- Parameters
-
- Returns
- the message object corresponding to the arguments
◆ makeMessageBody()
static binary Mime::MultiPartFormDataMessage::makeMessageBody |
( |
hash< string, hash< FormDataMessageInfo > > |
parts | ) |
|
|
static |
creates a multipart/form-data message body from a hash of FormDataMessageInfo hashes keyed by part name
- Parameters
-
- Returns
- the serialized message body corresponding to the arguments
◆ parseMessage()
static hash< string, hash< FormDataMessageInfo > > Mime::MultiPartFormDataMessage::parseMessage |
( |
string |
content, |
|
|
string |
body |
|
) |
| |
|
static |
parses a multipart/form-data encoded message and returns a hash of its ContentTransEnc7Bit
- Parameters
-
content | the message Content-Type string which must contain the message boundary string |
body | the message body to parse |
- Returns
- a hash of FormDataMessageInfo hashes keyed by part name
- Exceptions
-
MULTIPART-FORMDATA-MESSAGE-ERROR | cannot find message boundary string; invalid form-data part data |
- Since
- Mime 1.4
◆ splicePart() [1/3]
Mime::MultiPartFormDataMessage::splicePart |
( |
data |
mime_data, |
|
|
string |
name, |
|
|
*hash |
hdr |
|
) |
| |
adds a message part to the start of the list
- Parameters
-
mime_data | the data for the part |
name | the unique name for the part |
hdr | an optional hash of headers for the part |
- Exceptions
-
MULTIPART-FORMDATA-ERROR | the name parameter is empty or conflicts with an existing part name |
◆ splicePart() [2/3]
Mime::MultiPartFormDataMessage::splicePart |
( |
data |
mime_data, |
|
|
string |
name, |
|
|
string |
filename, |
|
|
string |
content_type, |
|
|
*hash |
hdr |
|
) |
| |
adds a message part to the start of the list
- Parameters
-
mime_data | the data for the part |
name | the unique name for the part |
filename | the filename for the part |
content_type | the content_type for the part |
hdr | an optional hash of headers for the part |
- Exceptions
-
MULTIPART-FORMDATA-ERROR | the name parameter is empty or conflicts with an existing part name; empty filename or content_type arguments |
◆ splicePart() [3/3]
adds a message part to the start of the list
- Parameters
-
h | the information for this part |
- Exceptions
-
MULTIPART-FORMDATA-ERROR | the name parameter is empty or conflicts with an existing part name; empty filename or content_type arguments |