[Vuejs]-Symfony + VueJs + Axios = No send form parameters

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!

👤Breith

Leave a comment