Rank: Newbie Groups: Member
Joined: 4/8/2015 Posts: 1
|
Hi, Is there a way to allow custom headers when sending XMLHttpRequest? I use request.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); but this header is not sent, and not treated as an AJAX-call on my server-end
How can I fix this?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
setRequestHeader is the correct way to do this. You must call it after open and before send. Otherwise it won't work.
Thanks!
|