Unable to access Posted information in Custom Controller
Content
Hey All,
I'm playing around with the Javascript Fetch API but I am unable to send data. I preform the post with a simple bit of data to send and echo the data on the controller side. When i exec the fetch function it shows that the $_POST array is empty.
Am I doing something wrong? Does RNT do something special that is tripping me up here?
Thanks,
Simon
Version
3.7Code Snippet
JS function genProductList4(){ fetch("/cc/AjaxReportCaller/productSelector", { method: 'POST', data:{language: 'ru'}, credentials: 'same-origin' }) .then((res) => res.text()) .then((data) => console.log(data)); } PHP function productSelector(){ echo "Where are the posts? \n"; var_dump( $_POST ); } RESPONSE genProductList4() undefined Where are the posts? array(0) { }
0