Create Three Symfony Back Ends - Part #18 - Handling POST requests in FOSRESTBundle
Feb 14, 2023
As our Behat tests rely on being able to "dogfood" our own API in order to run, the most important and immediately urgent task is to get the POST endpoint up and running.
We're going to make use of FOSRESTBundle's Automatic route generation facility to help speed up this process for us. This means we must follow a set convention for controller method naming. If you prefer, manually configured routing is available. We briefly covered this towards the end of the previous video, but as ever, the docs are your friend.
We'll need a few bits in place:
A new Controller class
FOSRESTBundle Routing setup
A postAction
Let's start by adding in the routing setup, as it's really easy.
Show More Show Less 