add clear

This commit is contained in:
as2252258@163.com
2020-01-03 11:39:57 +08:00
parent 44dd66dc6b
commit 0220bb69b0
+3
View File
@@ -467,6 +467,9 @@ 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;
}
$data = simplexml_load_string($body, 'SimpleXMLElement', LIBXML_NOCDATA);
return json_decode(json_encode($data), TRUE);
} else if (strpos($type, 'plain') !== false) {