code: def parse_content_type(header):
      
      typ = subtyp = None; options = {}
      typ, pos = expect_re(re_token, header, 0)
      _, pos = expect_lit('/', header, pos)
      subtyp, pos = expect_re(re_token, header, pos)
      ctype = header[:pos] if subtyp else ''
      while pos < len(header):
          _, pos = accept_ws(header, pos)
          _, pos = expect_lit(';', header, pos)
          _, pos = accept_ws(header, pos)
          name, pos = expect_re(re_token, header, pos)
          _, pos = expect_lit('=', header, pos)
          char = lookahead(header, pos)
          if char == '"':
              value, pos = expect_re(re_qstring, header, pos)
              value = re_qpair.sub('\\1', value)
          elif char:
              value, pos = expect_re(re_token, header, pos)
          if name and value is not None:
              options[name] = value
      return ctype, options
docs: Parse the "Content-Type" header.