public function __construct( ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory ) { $this->responseFactory = $responseFactory; $this->streamFactory = $streamFactory; } public function handle( ServerRequestInterface $request ): ResponseInterface { // ུ return $this->responseFactory->createResponse() ->withHeader('Content-Type', 'application/json') ->withBody($this->streamFactory->createStream($data)); } };