HttpRequestService::parseResponse PHP Method

parseResponse() public method

* Parse response, including json, xml, plain text
public parseResponse ( $resp, $ext = '' )
$resp String
$ext String, including json/xml
    public function parseResponse($resp, $ext = '')
    {
        $ext = !in_array($ext, self::$supportExtension) ? $this->decodeFormat : $ext;
        switch ($ext) {
            case 'json':
                $resp = json_decode($resp);
                break;
            case 'xml':
                $resp = self::xml_decode($resp);
                break;
        }
        return $resp;
    }