Skip to content

Kirby 4.2.0

$visitor->prefersJson()

Returns true if the visitor prefers a JSON response over an HTML response based on the Accept request header

$visitor->prefersJson(): bool

Return type

bool

Parent class

Kirby\Http\Visitor