title: Subrequests with post vars
body: <p>Here's the big picture: I am writing a symfony2 bundle for my web application. This application consists in a standard website with CRUD controllers. And on the other side it contains a rest api that also manages creation/edit/... on entities.</p>
  
  <p>I started writing the <code>Rest\UserController</code> for the <code>User</code> entity. It contains all standard REST actions (GET, POST, PUT, DELETE). It is based on the very good tutorial by William Durand: <a href="http://williamdurand.fr/2012/08/02/rest-apis-with-symfony2-the-right-way/" rel="nofollow">http://williamdurand.fr/2012/08/02/rest-apis-with-symfony2-the-right-way/</a></p>
  
  <p>Once this was created and functional I have created another <code>UserController</code> to handle the web side of the application. In this controller I have an action called <code>editAction</code> that renders a form in an HTML response. This form, when submitted sends a PUT request to the same controller's action <code>putAction</code>. My idea was to forward the request to <code>Rest\UserController</code> with action <code>putAction</code>. Here is the code for <code>UserController::putAction</code>:</p>
  
  <pre><code>    /**
       * This action forwards the request to the REST controller. It redirects
       * to a user list upon success, or displays the message should an error
       * occur.
       * @Route("/{id}/put", name="igt_user_put")
       * @Method("PUT")
       */
      public function putAction (User $user)
      {
          $response = $this-&gt;forward('MyBundle:Rest\User:put', array('id'=&gt;$user-&gt;getId()));
          if ($response-&gt;getStatusCode() == Response::HTTP_NO_CONTENT) {
              return new RedirectResponse($this-&gt;generateUrl('igt_user_list'));
          }
          return $response;
      }
  </code></pre>
  
  <p>This works like a charm and it feels like it is the good way to do it. The problem occurred when I thought I'd do the same for user activation/deactivation. I'd have a <code>lockAction</code> in my <code>UserController</code> that would run a request through the "Rest\UserController::putAction` with synthetic data to change the enabled field.</p>
  
  <p>But my problem is that there seems to be no way to set the POST vars in the forward call (only path and query). I even tried using $kernel->handle($request) with a synthetic request but it doesn't find my Rest controller's routes.</p>
  
  <p>Am I missing something ?</p>