Symfony 2 redirect using POST
php, request, symfony
Solution
It's impossible to redirect a POST request because the browser would have to re-send the POST data (which it doesn't). What you should do instead in this case is use forwarding.
Problem
In Symfony 2 I have the following code in my Controller: ``` // prepare to render the seller info panel $response = array( 'data' => $data, ); // render the seller info panel return $this->redirect($this->generateUrl('route', $response)); ``` where route is: ``` route: pattern: /listing/complete/{data} defaults: { _controller: FooBundle:Foo:action } requirements: _method: POST ``` This doesn't work since the redirect is making a GET request. I've also tried it this pattern, but its not matching the route: ``` route: pattern: /listing/complete defaults: { _controller: FooBundle:Foo:action } requirements: _method: POST ``` I've found the routing documentation unhelpful. Is there a way that I can have the redirect make a POST request? What would the route look like, and do I have to do anything in the controller to make it happen?