That is because the documentation is referring to the WSGI envrion
dictionary (and thus the CGI spec). This is how the translation from the
client to the server works: X-My-Header becomes HTTP_X_MY_HEADER. It isn't
wrong IMO.

On Sun, Jun 5, 2016 at 8:52 AM Vignesh Tnj <vigneshtn...@gmail.com> wrote:

> 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
> <https://groups.google.com/d/msgid/django-developers/7a88b8d8-b15f-4377-8264-e94130ad041e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
*[]'s*
*Paulo Poiati*
blog.paulopoiati.com

-- 
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/CABqSV%3DJNiAPpR%3DW5kZa5-gm2Kmn%2BYJV2G1dxBoiBCGtJGN8-hQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to