EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
September 18, 2024, 07:44:54 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Setting form request header
Pages: [
1
]
« previous
next »
Print
Author
Topic: Setting form request header (Read 11800 times)
devnull
Sr. Member
Posts: 431
Setting form request header
«
on:
October 12, 2012, 04:10:30 AM »
can you tell me how to apply the header:
setRequestHeader("X-Requested-With", "XMLHttpRequest")
to the easyui form object as does not appear to be set ?
Thanks
Logged
-- Licensed User --
stworthy
Administrator
Hero Member
Posts: 3581
Re: Setting form request header
«
Reply #1 on:
October 13, 2012, 04:52:10 AM »
Setting header is not supported in form plugin.
Logged
arma
Full Member
Posts: 110
Re: Setting form request header
«
Reply #2 on:
April 16, 2018, 03:32:33 PM »
Any workaround for this so we can identify in backend if post request is an ajax request?
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Setting form request header
«
Reply #3 on:
April 16, 2018, 06:48:33 PM »
Try to call ajaxSetup to set the header globally. Make sure to set the 'iframe' to false when submitting a form.
Code:
$.ajaxSetup( {
headers: {
//...
}
});
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...