I am using Jquery DataTable. And using making ajax calls (CROSS DOMAIN Request) like this to get the data:
ajax: {
url: url,
type: 'POST',
dataType: 'json',
contentType: 'application/x-www-form-urlencoded; charset=UTF-8'
}
This is how the header looks for this request in IE 8
Key Value
Request POST /api/data HTTP/1.1
Accept */*
Origin http://localhost:5000
Accept-Language en-US
Accept-Encoding gzip, deflate
User-Agent Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)
Host localhost:5555
Content-Length 3647
DNT 1
Connection Keep-Alive
Cache-Control no-cache
The Jquery DataTable automatically post the content to the server. But when the request is sent through IE 8, server is not receiving any data in HttpContext.Current.Request.Form
object. I am using below code to read the data posted by the server.
var formData = HttpContext.Current.Request.Form;
var direction = formData["order[0][dir]"];
var draw = Convert.ToInt32(formData["draw"]);
var length = Convert.ToInt32(formData["length"]);
var start = Convert.ToInt32(formData["start"]);
If I post request through chrome or FireFox, I get the data on the server. When the request is going through IE 8 content type header is not set. I think this is the reason why data is not available on the server side. Please help !!