public function testGetEncodedBody()
 {
     $r1 = new Request('POST', 'http://whatever', null, array('foo' => 'bar', 'baz' => 'qux'), array('content-type' => 'application/x-www-form-urlencoded'));
     $r2 = new Request('POST', 'http://whatever', null, array('foo' => 'bar', 'baz' => 'qux'), array('content-type' => 'application/json'));
     $r3 = new Request('POST', 'http://whatever', null, array('foo' => 'bar', 'baz' => 'qux'));
     $r4 = new Request('POST', 'http://whatever', null, 'foo-encoded-text', array('content-type' => 'foo'));
     $this->assertEquals('foo=bar&baz=qux', $r1->getEncodedBody());
     $this->assertEquals('{"foo":"bar","baz":"qux"}', $r2->getEncodedBody());
     $this->assertEquals('{"foo":"bar","baz":"qux"}', $r3->getEncodedBody());
     // JSON by default
     $this->assertEquals('foo-encoded-text', $r4->getEncodedBody());
 }