Skip to content

Commit

Permalink
Feat: do not override default headers when fire a json-type request
Browse files Browse the repository at this point in the history
  • Loading branch information
godruoyi committed Jan 2, 2025
1 parent a6f5202 commit 3021716
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Support/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function json($url, $data = [], $queries = [], array $options = [], $enco
{
is_array($data) && $data = json_encode($data, $encodeOption);

$this->setHeaders(['Content-Type' => 'application/json']);
$options = array_merge(['headers' => ['Content-Type' => 'application/json']], $options);

return $this->request('POST', $url, array_merge([
'query' => $queries,
Expand Down
3 changes: 1 addition & 2 deletions src/Support/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

namespace Godruoyi\OCR\Support;

use function implode;

use Monolog\Formatter\LineFormatter;
use Monolog\Handler\ErrorLogHandler;
use Monolog\Handler\HandlerInterface;
Expand All @@ -22,6 +20,7 @@
use Monolog\Logger as Monolog;
use Psr\Log\LoggerInterface;

use function implode;
use function sprintf;

class Logger implements LoggerInterface
Expand Down

0 comments on commit 3021716

Please sign in to comment.