werkzeug.parse_options_header(value, multiple=False)[source]

Parse a Content-Type like header into a tuple with the content type and the options:

>>> parse_options_header('text/html; charset=utf8')
('text/html', {'charset': 'utf8'})

This should not be used to parse Cache-Control like headers that use a slightly different format. For these headers use the parse_dict_header() function.

New in version 0.5.

  • value – the header to parse.
  • multiple – Whether try to parse and return multiple MIME types

(mimetype, options) or (mimetype, options, mimetype, options, …) if multiple=True