$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.