(filename: str, content_type: ty.Optional[str] = None)
return {'Content-Type': content_type if content_type else utils.guess_mimetype(filename)}
Returns a dict with the content-type header for a file.
	
	Guesses the mimetype for a filename and returns a dict
	containing the content-type header.
	
	.. code-block:: python
	
		>>> content_type_headers('example.txt')
		{'Content-Type': 'text/plain'}
		
		>>> content_type_headers('example.jpeg')
		{'Content-Type': 'image/jpeg'}
		
		>>> content_type_headers('example')
		{'Content-Type': 'application/octet-stream'}
	
	Parameters
	----------
	filename
		Filename to guess the content-type for
	content_type
		The Content-Type to use; if not set a content type will be guessed
Returns a dict with the content-type header for a file.
	
	Guesses the mimetype for a filename and returns a dict
	containing the content-type header.
	
	.. code-block:: python
	
		>>> content_type_headers('example.txt')
		{'Content-Type': 'text/plain'}
		
		>>> content_type_headers('example.jpeg')
		{'Content-Type': 'image/jpeg'}
		
		>>> content_type_headers('example')
		{'Content-Type': 'application/octet-stream'}
	
	Parameters
	----------
	filename
		Filename to guess the content-type for
	content_type
		The Content-Type to use; if not set a content type will be guessed
Returns a dict with the content - type header for a file . Guesses the mimetype for a filename and returns a dict containing the content - type header . .. code - block :: python >>> content_type_headers ( example . txt ) { Content - Type : text / plain } >>> content_type_headers ( example . jpeg ) { Content - Type : image / jpeg } >>> content_type_headers ( example ) { Content - Type : application / octet - stream } Parameters ---------- filename Filename to guess the content - type for content_type The Content - Type to use ; if not set a content type will be guessed
def content_type_headers(filename: str, content_type: ty.Optional[str] = None) \
    -> ty.Dict[str, str]:
	"""Returns a dict with the content-type header for a file.
	
	Guesses the mimetype for a filename and returns a dict
	containing the content-type header.
	
	.. code-block:: python
	
		>>> content_type_headers('example.txt')
		{'Content-Type': 'text/plain'}
		
		>>> content_type_headers('example.jpeg')
		{'Content-Type': 'image/jpeg'}
		
		>>> content_type_headers('example')
		{'Content-Type': 'application/octet-stream'}
	
	Parameters
	----------
	filename
		Filename to guess the content-type for
	content_type
		The Content-Type to use; if not set a content type will be guessed
	"""
	return {'Content-Type': content_type if content_type else utils.guess_mimetype(filename)}
def content_type_headers ( filename : str , content_type : ty . Optional [ str ] = None ) -> ty . Dict [ str , str ] : return { 'Content-Type' : content_type if content_type else utils . guess_mimetype ( filename ) }