/** * Constructor * @param string $body The HTTP response body * @param int $status The HTTP response status * @param \Slim\Http\Headers|array $headers The HTTP response headers */ public function __construct($body = '', $status = 200, $headers = array()) { $this->setStatus($status); $this->headers = new \Slim\Http\Headers(array('Content-Type' => 'text/html')); $this->headers->replace($headers); $this->cookies = new \Slim\Http\Cookies(); $this->write($body); }
/** * Constructor * @param string $body The HTTP response body * @param int $status The HTTP response status * @param \Slim\Http\Headers|array $headers The HTTP response headers */ public function __construct($body = '', $status = 200, $headers = array()) { $this->setStatus($status); $this->headers = new \Slim\Http\Headers(array('Content-Type' => 'application/json', 'charset=utf-8')); $this->headers->replace($headers); $this->cookies = new \Slim\Http\Cookies(); $this->write($body); }