RestController and HttpResponse

Hi,
I am switching my system from Typo3 Flow to Neos Flow 7.
I know there have been groundbreaking changes regarding the response object.

Instead of my json data an array(0) is returned on a successful POST statement now.
I’ve read through the release notes but I don’t quite understand how I need to change my code:

class SubmissionRestController extends RestController {
..
public function createObjektAction(...) {

$this->response->setContentType('application/json');
$this->response->setContent('{"objektid":"1000"}');
$this->response->setStatus(201);
..
}
}

in short: $value is not returned by using $this->response->setContent($value) anymore

Just returning $value from the Action should be sufficient

if I do “return $value;” and $value=“123” I get :

array(0) {
}
123

Hi :wink:

It’s always helpful to look at other Code in neos and flow and just visit the extended class :wink:

A few things are also here explained Model View Controller — Flow Framework 8.3.x documentation

solved it with:

ob_start()
....
ob_end_clean();
return '{"objektid":'.$objektid.'}';