Skip to content

Commit

Permalink
prevent wrong content on GET requests
Browse files Browse the repository at this point in the history
  • Loading branch information
bandi committed Sep 10, 2024
1 parent 76f2e8c commit 9ab07c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Moadian.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function __construct($privateKey, $certificate, $baseUri ='https://tp.tax
$this->client = new Client([
'base_uri' => $baseUri,
'headers' => ['Content-Type' => 'application/json'],
'timeout' => 60
]);
$this->signer = new SignatureService($privateKey, $certificate);
$this->encryptor = new EncryptionService();
Expand All @@ -43,8 +44,9 @@ public function sendRequest(Request $request)
{
$request->prepare($this->signer, $this->encryptor);

$body = !empty($request->getBody()) ? json_encode($request->getBody()) : null;
$httpResp = $this->client->request($request->method, $request->path, [
'body' => json_encode($request->getBody()),
'body' => $body,
'headers' => $request->getHeaders(),
'query' => $request->getParams()
]);
Expand Down

0 comments on commit 9ab07c1

Please sign in to comment.