$response->setContentType('application/pdf'); $response->setContentType('text/plain', 'UTF-8');
public function setContentType($contentType, $charset = null) { if ($charset === null) { $this->setHeader('Content-Type', $contentType); } else { $this->setHeader('Content-Type', $contentType . '; charset=' . $charset); } return $this; }