s3.content_type_for()

Return the content type an object should be served as, by its suffix.

Usage

Source

s3.content_type_for(path)

Parameters

path: str, Path, or UPath
Object name or path. Only the suffix is read, case-insensitively.

Returns

str
A media type from CONTENT_TYPES, or application/octet-stream for an unlisted suffix rather than a guess.