api/MarkLogic/MLPHP/RESTResponse.php
public function getBodyType()
    {
        $result = '';
        if (json_decode($this->body)) {
            $result = 'json';
        } else if (substr(trim($this->body), 0, 1) === '<') {
            $result = 'xml';
        } else {
            $result = 'other';
        }
        return $result;
    }
public function getBodyType()
    {
        $result = '';
        if (json_decode($this->body)) {
            $result = 'json';
        } else if (substr(trim($this->body), 0, 1) === '<') {
            $result = 'xml';
        } else {
            $result = 'other';
        }
        return $result;
    }
Get the format type of the body.

@return string The type:
'json', 'xml', or 'other' (for non-JSON, non-XML text)