0👍
in Symfony try with: $request->getContent()
.
Exemple:
// ...
class HomeController extends AbstractController {
//...
/**
* @Route("/send", name="send")
*/
public function sendForm(Request $request) {
// Decode data with json_decode()
$data = json_decode($request->getContent(), true);
$name = $data['name'];
return $this->json($name);
}
//...
}
Enjoy!
Source:stackexchange.com