protected function detectFormatByContent($content)
    {
        if (preg_match('/^(\\{|\\[\\{).*(\\}|\\}\\])$/is', $content)) {
            return Client::FORMAT_JSON;
        }
        if (preg_match('/^([^=&])+=[^=&]+(&[^=&]+=[^=&]+)*$/', $content)) {
            return Client::FORMAT_URLENCODED;
        }
        if (preg_match('/^<\?xml.*>$/s', $content)) {
            return Client::FORMAT_XML;
        }
        return null;
    }
protected function detectFormatByContent($content)
    {
        if (preg_match('/^(\\{|\\[\\{).*(\\}|\\}\\])$/is', $content)) {
            return Client::FORMAT_JSON;
        }
        if (preg_match('/^([^=&])+=[^=&]+(&[^=&]+=[^=&]+)*$/', $content)) {
            return Client::FORMAT_URLENCODED;
        }
        if (preg_match('/^<\?xml.*>$/s', $content)) {
            return Client::FORMAT_XML;
        }
        return null;
    }
protected function detectFormatByContent ( $ content ) { if ( preg_match ( '/^(\\{|\\[\\{).*(\\}|\\}\\])$/is' , $ content ) ) { return Client :: FORMAT_JSON ; } if ( preg_match ( '/^([^=&])+=[^=&]+(&[^=&]+=[^=&]+)*$/' , $ content ) ) { return Client :: FORMAT_URLENCODED ; } if ( preg_match ( '/^<\?xml.*>$/s' , $ content ) ) { return Client :: FORMAT_XML ; } return null ; }
Detects response format from raw content.
@param string $content raw response content.
@return null|string format name, 'null' - if detection failed.
Detects response format from raw content .