expectsJson method

bool expectsJson()

True when the client wants a JSON answer, not a page: an Accept header with json, a JSON body, or an X-Requested-With: XMLHttpRequest header. An Inertia request (X-Inertia) is not.

Implementation

bool expectsJson() => expectsJsonFor(httpHeaders);