Boost C++ Libraries

PrevUpHomeNext

Function mime_type_for

boost::taar::mime_type_for — Media type for filename from the built-in table, without parameters.

Synopsis

// In header: <boost/taar/core/mime.hpp>


std::string_view mime_type_for(std::string_view filename);

Description

Matching is case-insensitive on the last extension (see file_extension). The table covers web documents, scripts, styles, images, fonts, audio, video, archives and office formats; JavaScript is text/javascript (RFC 9239).

Returns:

The media type, or an empty view for an unknown extension.


PrevUpHomeNext