We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df39022 commit 83543f0Copy full SHA for 83543f0
Test/HttpClientTestCase.php
@@ -399,6 +399,21 @@ public function testOnProgress()
399
$this->assertSame('http://localhost:8057/post', $steps[0][2]['url']);
400
}
401
402
+ public function testPostJson()
403
+ {
404
+ $client = $this->getHttpClient();
405
+
406
+ $response = $client->request('POST', 'http://localhost:8057/post', [
407
+ 'json' => ['foo' => 'bar'],
408
+ ]);
409
410
+ $body = $response->toArray();
411
412
+ $this->assertContains('json', $body['content-type']);
413
+ unset($body['content-type']);
414
+ $this->assertSame(['foo' => 'bar', 'REQUEST_METHOD' => 'POST'], $body);
415
+ }
416
417
public function testPostArray()
418
{
419
$client = $this->getHttpClient();
0 commit comments