ManaPHP\Http\Response::setContentType PHP Method

setContentType() public method

Sets the response content-type mime, optionally the charset $response->setContentType('application/pdf'); $response->setContentType('text/plain', 'UTF-8');
public setContentType ( string $contentType, string $charset = null ) : static
$contentType string
$charset string
return static
    public function setContentType($contentType, $charset = null)
    {
        if ($charset === null) {
            $this->setHeader('Content-Type', $contentType);
        } else {
            $this->setHeader('Content-Type', $contentType . '; charset=' . $charset);
        }
        return $this;
    }