VortexMimeHeader * vortex_frame_get_mime_header ( VortexFrame frame,
const char *  mime_header 

Allows to get the content associated to a particular header.

frame The frame where the MIME header content will be retrieved.
mime_header The MIME header to get. See supported MIME headers.
A reference to the content of the MIME header or NULL if it fails or nothing is found. The function can only fail if some parameter provided is NULL.
Supported MIME headers:

The following are a set of macros that can be used to retrieve common MIME headers. You can still use direct string, but using them will disable compilation protection. For example:

 // get content for MIME header "Content-Type"
 VortexMimeHeader * header = vortex_frame_get_mime_header (frame, MIME_CONTENT_TYPE);

 // now get the content 
 const char       * value  = vortex_frame_mime_header_content (header);

 // for other MIME header that have allowed repeatable value values use next
 header = vortex_frame_mime_header_next (header);

 // to simply get the first header do (returns first reference):

NOTE: There is an especial note about the "Content-Type" and "Content-Transfer-Encoding". If they aren't defined, it is assumed the following default values (RFC 3080, section 2.2):

  • "Content-Type" is "application/octet-stream"
  • "Content-Transfer-Encoding" is "binary"

In the case you don't want to receive NULL values and assume previous values, you must use vortex_frame_get_content_type and vortex_frame_get_transfer_encoding, which returns the appropiate values if they found the MIME status no holding such values.