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 d4b3e8b commit 970e4abCopy full SHA for 970e4ab
src/Traits/HttpBodyTrait.php
@@ -45,6 +45,9 @@ public function withAddedBody(string $body): object
45
*/
46
public function withBodyJson($body): object
47
{
48
+ if (!$this->hasHeader('Content-Type')) {
49
+ $this->withHeader('Content-Type', 'application/json');
50
+ }
51
return $this->withBody(json_encode($body));
52
}
53
0 commit comments