'True if the request was triggered by a XMLHttpRequest. This only
works with JavaScript libraries that support the `X-Requested-With`
header (most of the popular libraries do).'

@property
def is_xhr(self):

    requested_with = self.environ.get('HTTP_X_REQUESTED_WITH', '')
    return (requested_with.lower() == 'xmlhttprequest')
