Quantcast
Channel: What's the point of the X-Requested-With header? - Stack Overflow
Viewing all articles
Browse latest Browse all 4

What's the point of the X-Requested-With header?

$
0
0

JQuery and other frameworks add the following header:

X-Requested-With: XMLHttpRequest

Why is this needed? Why would a server want to treat AJAX requests differently than normal requests?

UPDATE: I just found a real-life example using this header: https://core.spreedly.com/manual/payment-methods/adding-with-js. If the payment processor is requested without AJAX, it redirects back to the original website when it's done. When it is requested with AJAX, no redirection is done.


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images