code: def update_headers(self, headers: Optional[LooseHeaders]) -> None:
          
          self.headers = CIMultiDict()  # type: CIMultiDict[str]
  
          # add host
          netloc = cast(str, self.url.raw_host)
          if helpers.is_ipv6_address(netloc):
              netloc = '[{}]'.format(netloc)
          if not self.url.is_default_port():
              netloc += ':' + str(self.url.port)
          self.headers[hdrs.HOST] = netloc
  
          if headers:
              if isinstance(headers, (dict, MultiDictProxy, MultiDict)):
                  headers = headers.items()  # type: ignore
  
              for key, value in headers:
                  # A special case for Host header
                  if key.lower() == 'host':
                      self.headers[key] = value
                  else:
                      self.headers.add(key, value)
docs: Update request headers.