yii\web\Request::getContentType PHP Method

getContentType() public method

For the MIME-types the user expects in response, see [[acceptableContentTypes]].
public getContentType ( ) : string
return string request content-type. Null is returned if this information is not available.
    public function getContentType()
    {
        if (isset($_SERVER['CONTENT_TYPE'])) {
            return $_SERVER['CONTENT_TYPE'];
        } elseif (isset($_SERVER['HTTP_CONTENT_TYPE'])) {
            //fix bug https://bugs.php.net/bug.php?id=66606
            return $_SERVER['HTTP_CONTENT_TYPE'];
        }
        return null;
    }