title: KernelBrowser adding params to body POST request
body: <p>I'm trying to test an endpoint of my Api with phpunit and the symfony WebTestCase object. I have to send a POST request with the KernelBrowser but I can't figure it out how to add parameters to the body of the request. My request work fine on postman.</p>
  <p>I've tried this
  <code>$client-&gt;request('POST', '/url', ['param1' =&gt;'value1', 'param2' =&gt; 'value2']);</code></p>
  <p>It's not working.</p>
  <p>I've tried this
  <code>$client-&gt;request('POST', '/url', [], [], [], '{param1: value, param2: value}');</code></p>
  <p>It doesn't work,
  I can't use the <code>$client-&gt;submitForm()</code> method because the form is send by another app.</p>
  <p>Maybe it came from my Api endpoint because I'm using $_POST variable ?:</p>
  <pre><code>$res = false;
  if(count($_POST) === 2){
    $user = $this-&gt;userrepo-&gt;findByName($_POST['value1']);
    if($user){
      if($this-&gt;passwordEncoder-&gt;isPasswordValid($user[0], $_POST['value2'])){
        $res = true;   
      }
    }
  }
  return new Response($this-&gt;serializer-&gt;serialize(['isChecked' =&gt; $res], 'json'));
  </code></pre>
  <p>My test method has never passed the first if statement,
  here my test method:</p>
  <pre><code>$client = static::createClient();
  $client-&gt;request('POST', '/url', ['value1' =&gt; 'value1', 'value2' =&gt; 'value2']);
  $this-&gt;assertStringContainsString('{&quot;isChecked&quot;:true}', $client-&gt;getResponse()-&gt;getContent());
  </code></pre>
  <p>Here the POST request I'm trying to send:</p>
  <pre><code>curl --location --request POST 'http://localhost:8000/url' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --form 'value1=value1' \
  --form 'value2=value2'
  </code></pre>