Skip to content

Commit

Permalink
Feat: do not override default headers when fire a json-type request (#22
Browse files Browse the repository at this point in the history
)

* Feat: do not override default headers when fire a json-type request

* fix lint
  • Loading branch information
godruoyi authored Jan 2, 2025
1 parent a6f5202 commit 4ba81c2
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 4ba81c2

Please sign in to comment.