Request::getContentType(): string|null

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Gets the Content-Type header value.

Return

string|null The Content-Type header value or null if not set.

Source

private function getContentType(): ?string
{
    $values = $this->getHeader('Content-Type');
    return $values !== null ? $values[0] : null;
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.