Got Blank issue for get data from /wp-json/v2/post

the documentation that said there is the limit I got from this Post

WP REST API returns blank response if post is too long

and just I just solve it
So How to fix this? I made a custom API, and convert my data to JSON using json_encode by using the option.

Solution $json = json_encode($your_array, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)

return $json

by using that solution, you no need to echo the data.

Thanks for helping.