add clear
This commit is contained in:
@@ -465,6 +465,9 @@ class HttpClient
|
|||||||
private function resolve($data, $body)
|
private function resolve($data, $body)
|
||||||
{
|
{
|
||||||
$type = $data['Content-Type'] ?? $data['content-type'];
|
$type = $data['Content-Type'] ?? $data['content-type'];
|
||||||
|
if (is_array($body)) {
|
||||||
|
return $body;
|
||||||
|
}
|
||||||
if (strpos($type, 'json') !== false) {
|
if (strpos($type, 'json') !== false) {
|
||||||
return json_decode($body, true);
|
return json_decode($body, true);
|
||||||
} else if (strpos($type, 'xml') !== false) {
|
} else if (strpos($type, 'xml') !== false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user