code: def content_disposition_header(disptype: str,
                                 quote_fields: bool=True,
                                 **params: str) -> str:
      
      if not disptype or not (TOKEN > set(disptype)):
          raise ValueError('bad content disposition type {!r}'
                           ''.format(disptype))
  
      value = disptype
      if params:
          lparams = []
          for key, val in params.items():
              if not key or not (TOKEN > set(key)):
                  raise ValueError('bad content disposition parameter'
                                   ' {!r}={!r}'.format(key, val))
              qval = quote(val, '') if quote_fields else val
              lparams.append((key, '"%s"' % qval))
              if key == 'filename':
                  lparams.append(('filename*', "utf-8''" + qval))
          sparams = '; '.join('='.join(pair) for pair in lparams)
          value = '; '.join((value, sparams))
      return value
docs: Sets ``Content-Disposition`` header.
  
      disptype is a disposition type: inline, attachment, form-data.
      Should be valid extension token (see RFC 2183)
  
      params is a dict with disposition params.