Hi,
I just started working with KendoUI mobile and was trying to call a REST Service. Below is my code,
<script>
$(document).ready(function() {
// create a template using the above definition
var template = kendo.template($("#template").html());
var dataSource = new kendo.data.DataSource({
type: "odata",
type: 'POST',
transport: {
read: "https://172.17.4.172:8443/prt/rest/crmapp/api/CrmGetAccounts",
beforeSend: function(xhr)
{
xhr.setRequestHeader('X-token','711761306837443264')
}
},
change: function() { // to the CHANGE event of the data source
// update the max attribute of the "page" input
$("#page").attr("max", this.totalPages());
$("#products").html(kendo.render(template, this.view()));
}
});
// read data from the remote service
dataSource.read();
});
</script>
Asyou can see I am trying it our with changing sample code. My issue is the X-token is not getting added to the request header. I want it ot be passed as w HTTP header for the service to work.
Any help would be really appreciated,
Thanks,
Asat
I just started working with KendoUI mobile and was trying to call a REST Service. Below is my code,
<script>
$(document).ready(function() {
// create a template using the above definition
var template = kendo.template($("#template").html());
var dataSource = new kendo.data.DataSource({
type: "odata",
type: 'POST',
transport: {
read: "https://172.17.4.172:8443/prt/rest/crmapp/api/CrmGetAccounts",
beforeSend: function(xhr)
{
xhr.setRequestHeader('X-token','711761306837443264')
}
},
change: function() { // to the CHANGE event of the data source
// update the max attribute of the "page" input
$("#page").attr("max", this.totalPages());
$("#products").html(kendo.render(template, this.view()));
}
});
// read data from the remote service
dataSource.read();
});
</script>
Asyou can see I am trying it our with changing sample code. My issue is the X-token is not getting added to the request header. I want it ot be passed as w HTTP header for the service to work.
Any help would be really appreciated,
Thanks,
Asat