-
-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Description
src\Support\Http.php
public function json($url, $data = [], $queries = [], array $options = [], $encodeOption = JSON_UNESCAPED_UNICODE){
is_array($data) && $data = json_encode($data, $encodeOption);
$this->setHeaders(['Content-Type' => 'application/json']);
return $this->request('POST', $url, array_merge([
'query' => $queries,
'body' => $data,
], $options));
}It is proposed to be changed as follows
public function json($url, $data = [], $queries = [], array $options = [], $encodeOption = JSON_UNESCAPED_UNICODE){
is_array($data) && $data = json_encode($data, $encodeOption);
$options = array_merge($options, ['header' => ['Content-Type' => 'application/json']]);
return $this->request('POST', $url, array_merge([
'query' => $queries,
'body' => $data,
], $options));
}$this->setHeaders(['Content-Type' => 'application/json']); It is be a global setting, and it will dirty other requests
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels