mercredi 4 novembre 2020

Laravel: Cannot access empty property for array

I am making axios post to an endpoint I have with an array of objects:

dataTargets = [{target: "page:455880961418394", stream_url: "fds", stream_key: "sdf"}, {target: "page:f334234", stream_url: "test", stream_key: "test1"}]

axios.post('/admin/finish-live', {
   copy_urls: dataTargets
});

I've logged dataTargets right before the post call is made to ensure it's there.

My controller on the backend is trying to grab these, $request->copy_urls, but I'm getting the error Cannot access empty property for array but I know the data is being sent to the backend.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire