Home |
Function http_find_string_value Function http_mime_fields Function http_add_get_functions Function http_add_post_functions Function http_set_browser_list Function http_set_put_function |
Function http_mime_fieldsThis function can be used to define what MIME fields should be sent to HTTP clients in response to GET requests for specified file names. typedef struct mime_for_pages { const char * web_page; // Partial file name. An empty // string means apply to all web pages const char * mime_fields; // MIME fields separated by "\r\n" } MIME_FOR_PAGES; void http_mime_fields(struct mime_for_pages * web_fields); Parametersweb_fieldsPointer to an array of struct mime_for_pages structures associating file names with MIME fields. The last entry must be {NULL, NULL}. The Web servers goes through the supplied list comparing each web_page entry with the tail (case sensitive, not only the extension) of the requested file name. If a match is found, the search is terminated and the corresponding MIME field will be included in the header of the server's response. If an empty web_page string is encountered in the search, that header will also be added to the response headers. Example:struct mime_for_pages my_mime_headers[] = { {"", "X-Custom-Header: Any old string"}, {".htm", "Content-Type: text/html; charset=ISO-8859-1"}, {".sdp", "Content-Type: application/sdp"}, {NULL, NULL} }; ... http_mime_fields(my_mime_headers); Added MIME headers which contain a "Content-Type:" header replace the default Content-Type usually supplied by the server automatically. Function http_find_string_value
|