public function setContent(?string $content): static


    /**

     * Sets the response content.

     *

     * @return $this

     */

    public function setContent(?string $content): static

    {

        $this->content = $content ?? '';


        return $this;

    }


$response->setContent('Hello World');

// the headers public attribute is a ResponseHeaderBag
$response->headers->set('Content-Type', 'text/plain');

$response->setStatusCode(Response::HTTP_NOT_FOUND);


Powered by Froala Editor