def is_json_request():
 content_type = request.content_type
 return (content_type and ('application/json' in content_type))

def is_json_request ( ) : content_type = request . content_type return ( content_type and ( 'application/json' in content_type ) )
return true if the current request is a json/ajax request .