EasyUI Forum
April 22, 2018, 01:06:19 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Setting form request header  (Read 5341 times)
devnull
Sr. Member
****
Posts: 401


View Profile
« 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: 3243


View Profile Email
« Reply #1 on: October 13, 2012, 04:52:10 AM »

Setting header is not supported in form plugin.
Logged
arma
Full Member
***
Posts: 110


View Profile
« 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: 3243


View Profile Email
« 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  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!