flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.64k stars 407 forks source link

Return of Flight::json(Flight::request()->data) is empty? #400

Closed pwFoo closed 5 years ago

pwFoo commented 5 years ago

Should Flight::json() handle the Flight::request()->data object as input? At the moment the output is empty. I know it isn't sanitized by default, but that could be done by a hook and so it would be nice to just send it to Flight::json() to return valid json?

Or what is the Flight way to do it?

mikecao commented 5 years ago

You need to use Flight::request()->data->getData() to get the raw array that can be serialized.

pwFoo commented 5 years ago

Thanks, works fine!