If i do ajax call for form submit i can set header before sending request to server. But lets say i am hitting an action "url" to send data to server. In that case how to set any header for that request?
case1 :
<form onsubmit="somefn()">
<input type="text">
<input type="file">
<input type="submit">
</form>
In case 1 i can make an ajax call in "somefn()" and set request headers and send the form data.
case2:(For IE9 issue)
<form action="/someurl">
<input type="text">
<input type="file">
<input type="submit">
</form>
Here in cas2 form will be submitted to the specified action URL. In this scenario how to set headers for that request? Because here we are not doing any ajax call.Its normal form submit
Actual scenario is file upload in IE 9 using "iframe" submit. But i need to send a "authtoken" along with the request . Other browser we are doing http request. So can set the "authtoken" easily.
How to achieve it. Please help