title: symfony2 test client request with post data
body: <p>i want to test login with facebook on a symfony webapp, i've created a test user and requested an access token for this user, i want to send the below post request:</p>
  
  <pre><code>public function setup()
  {
      $this-&gt;access_token = 'CAAL0aG1XXXXXX...';
      $this-&gt;email = 'test....@tfbnw.net';
      $this-&gt;uid = '105.......';
      $this-&gt;formData =json_encode(
          array(
              'authResponse' =&gt; array(
                  'access_token' =&gt; $this-&gt;access_token,
                  'expiresIn' =&gt; 5418,
                  'userID' =&gt; $this-&gt;uid
              ),
              'status' =&gt; 'connected'));
  }
  
  public function testFacebookConnection()
  {
      $client = static::createClient();
      // Submit a raw JSON string in the request body
      $client-&gt;request(
          'POST',
          $client-&gt;getContainer()-&gt;get('router')-&gt;generate('oauth_connect'),
          array(),
          array(),
          array('CONTENT_TYPE' =&gt; 'application/json'),
          '{ "service":"facebook","authentication" : "'. $this-&gt;formData.'"}'
      );
      die(var_dump($client-&gt;getResponse()-&gt;getContent()));
  }
  </code></pre>
  
  <p>and below the call URI method signuature</p>
  
  <pre><code>/**
   * Calls a URI.
   *
   * @param string $method        The request method
   * @param string $uri           The URI to fetch
   * @param array  $parameters    The Request parameters
   * @param array  $files         The files
   * @param array  $server        The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does)
   * @param string $content       The raw body data
   * @param bool   $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload())
   *
   * @return Crawler
   */
  public function request($method, $uri, array $parameters = array(), array $files = array(), array $server = array(), $content = null, $changeHistory = true)
  {
  </code></pre>