add clear

This commit is contained in:
as2252258@163.com
2020-01-03 11:46:51 +08:00
parent 5ef309de4e
commit c9d7f52845
+2 -5
View File
@@ -469,13 +469,10 @@ class HttpClient
}
if (strpos($type, 'json') !== false) {
return json_decode($body, true);
} else if (strpos($type, 'xml') !== false || strpos($type, 'plain') !== false) {
if (!is_null($newBody = json_decode($body, true))) {
return $newBody;
}
} else if (strpos($type, 'xml') !== false) {
return Help::toArray($body);
} else if (strpos($type, 'plain') !== false) {
return json_decode($body, TRUE);
return Help::toArray($body);
} else {
return $body;
}