Search code examples
pythonflaskwerkzeug

How to check if request type is ajax in flask


Is there a simple way in flask to check if the request is ajax from view? Just like in django, its as easy as request.is_ajax() but I cant find anything like that for flask, i checked the docs but couldnt find it..


Solution

  • From Flask documentation:

    request.is_xhr
    

    Notice: This solution is deprecated and not viable anymore.