add clear
This commit is contained in:
@@ -467,6 +467,9 @@ class HttpClient
|
|||||||
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 || strpos($type, 'plain') !== false) {
|
} 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);
|
$data = simplexml_load_string($body, 'SimpleXMLElement', LIBXML_NOCDATA);
|
||||||
return json_decode(json_encode($data), TRUE);
|
return json_decode(json_encode($data), TRUE);
|
||||||
} else if (strpos($type, 'plain') !== false) {
|
} else if (strpos($type, 'plain') !== false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user