https://docs.djangoproject.com/en/1.9/ref/request-response/

" HttpRequest.is_ajax()[source] 
<https://docs.djangoproject.com/en/1.9/_modules/django/http/request/#HttpRequest.is_ajax>
¶ 
<https://docs.djangoproject.com/en/1.9/ref/request-response/#django.http.HttpRequest.is_ajax>

Returns True if the request was made via an XMLHttpRequest, by checking the 
HTTP_X_REQUESTED_WITH header for the string'XMLHttpRequest'. Most modern 
JavaScript libraries send this header. If you write your own XMLHttpRequest 
call (on the browser side), you’ll have to set this header manually if you 
want is_ajax() to work. "


if we set ,  xhttp.setRequestHeader('HTTP_X_REQUESTED_WITH', 
'XMLHttpRequest');     as said in doc

request.is_ajax()   return False

-------------------------------

if we set , http.setRequestHeader('X-Requested-With', 'XMLHttpRequest');

request.is_ajax()   return true

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/7a88b8d8-b15f-4377-8264-e94130ad041e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to