I am working on a Laravel project which should get an object via a POST request in JSON. I am getting the JSON as follows: $content = $request->getContent(); and decode it with $jsonObj = json_decode($content). But whenever I try to get a value from the JSON with $jsonObj->id I get Trying to get property 'id' of non-object. Whenever I log $jsonObj I still see the correct object. The JSON is correctly formatted and not in an array.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire