public function setContentType(string $mime, string $charset = 'UTF-8')
	{
		// add charset attribute if not already there and provided as parm
		if ((strpos($mime, 'charset=') < 1) && ! empty($charset))
		{
			$mime .= '; charset=' . $charset;
		}

		$this->removeHeader('Content-Type'); // replace existing content type
		$this->setHeader('Content-Type', $mime);

		return $this;
	}
public function setContentType(string $mime, string $charset = 'UTF-8')
	{
		// add charset attribute if not already there and provided as parm
		if ((strpos($mime, 'charset=') < 1) && ! empty($charset))
		{
			$mime .= '; charset=' . $charset;
		}

		$this->removeHeader('Content-Type'); // replace existing content type
		$this->setHeader('Content-Type', $mime);

		return $this;
	}
public function setContentType ( string $ mime , string $ charset = 'UTF-8' ) { // add charset attribute if not already there and provided as parm if ( ( strpos ( $ mime , 'charset=' ) < 1 ) && ! empty ( $ charset ) ) { $ mime .= '; charset=' . $ charset ; } $ this -> removeHeader ( 'Content-Type' ) ; // replace existing content type $ this -> setHeader ( 'Content-Type' , $ mime ) ; return $ this ; }
Sets the Content Type header for this response with the mime type
and, optionally, the charset.

@param string $mime
@param string $charset

@return Response
Sets the Content Type header for this response with the mime type and optionally the charset .