def wrapper(self, *args, **kwargs):
    if 'X-Requested-With' in self.request.headers:
        if self.request.headers['X-Requested-With'] == 'XMLHttpRequest':
            pass
How to run ajax request handler tornado