diff --git a/src/Transporters/HttpTransporter.php b/src/Transporters/HttpTransporter.php index 998983e..1335cb6 100644 --- a/src/Transporters/HttpTransporter.php +++ b/src/Transporters/HttpTransporter.php @@ -23,7 +23,6 @@ public function request(string $method, string $path, array $options = []): Resp $request = (new Request()) ->withMethod($method) ->withUrl($this->baseUrl->append($path)) - ->withHeaders($this->headers->with('Content-Type', 'application/json')) ->withBody($options['body'] ?? null); return $this->send($request); @@ -31,6 +30,7 @@ public function request(string $method, string $path, array $options = []): Resp public function send(Request $request): Response { + $request = $request->appendHeaders($this->headers->with('Content-Type', 'application/json')); try { $response = $this->httpClient->sendRequest($request->toPsr7Request());