Skip to content

Kirby 5.0.4

$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

This method modifies the existing $visitor object it is applied to and returns it again.

Parent class

Kirby\Http\Visitor