title: Symfony - Redirect with post data in a controller
body: <p>The goal is to register an idle user on my website and redirect it to a payment platform by sending the user data entered in the form via the POST method.</p>
  
  <p>I have a form in POST that I use to create an inactive user if this form is valid. I would then like to redirect my user to an external URL while sending the data from this form in POST to this URL. This URL accepts only specific variable names (these variables are in the associative array of my RedirectResponse) and only in POST.</p>
  
  <p>The user will make his payment on the external link and if the payment is successful I will activate the user later. I identify with the payment platform by sending her 'ID' and she has authorized my domain name.</p>
  
  <p>I tried to use RedirectResponse with status 307 but I think it is not possible to send it POST data.</p>
  
  <pre><code>     * @Route("/{id&lt;\d+&gt;?1}/{slug}", methods={"GET", "POST"}, name="show")
       * @Security("is_granted('IS_AUTHENTICATED_ANONYMOUSLY')")
       */
      public function show(Offre $offre, $slug, Request $request): Response
      {
          if ($offre-&gt;getSlug() !== $slug) {
              return $this-&gt;redirectToRoute('site_devenir_vip_show', [
                  'id'   =&gt; $offre-&gt;getId(),
                  'slug' =&gt; $offre-&gt;getSlug(),
              ], Response::HTTP_MOVED_PERMANENTLY);
          }
  
          $utilisateur = new User();
  
          $form = $this-&gt;createForm(UserType::class, $utilisateur);
          $form-&gt;handleRequest($request);
  
          if ($form-&gt;isSubmitted() === true) {
              if ($form-&gt;isValid() === true) {
                  // TODO: create the inactive User here
  
                  // TODO: redirect the user on the payment platform
                  return new RedirectResponse('https://mywebsite.com', 307, [
                      'NOM'        =&gt; $utilisateur-&gt;getNom(),
                      'PRENOM'     =&gt; $utilisateur-&gt;getPrenom(),
                      'TEL'        =&gt; $utilisateur-&gt;getTel(),
                      'EMAIL'      =&gt; $utilisateur-&gt;getEmail(),
                      'PAYS'       =&gt; $utilisateur-&gt;getPays(),
                      'ID'         =&gt; 'XXXX',
                      'ABONNEMENT' =&gt; 'XXXX',
                  ]);
              }
  
              $this-&gt;addFlash('error', 'Le formulaire comporte des erreurs.');
          }
  
          return $this-&gt;render('site/pages/devenir_vip/show.html.twig', [
              'offre' =&gt; $offre,
              'form'  =&gt; $form-&gt;createView(),
          ]);
      }
  </code></pre>
  
  <p>I am currently redirected to the external link that is in the RedirectResponse but it does not get the parameters. Do you have an idea ?</p>