File_get_contents

Is there a cake method for file_get_contents() ?

ex : $input = file_get_contents(‘php://input’);

Your going to need to use the File and Folder classes. They’re deprecated but will survive until v5. Or work out your own code with php directly.

What’s the problem with just using file_get_contents?

No problem. It works perfectly.
I just wondered in there was a specific cake way :slightly_smiling_face:

There’s the HTTP client, but it’s maybe meant for more complex cases. “CakePHP is PHP”, so if there’s a fine PHP way of handling things, then they don’t generally make an extra layer on top of that.

OK. Thank you again.

$request->input()

you can do for instance $jsonData = $this->request->input('json_decode');

Thank you for this trick