Hi friends
i try to fetch the XCSRF token
using Fiddler Response Header is given me token
but when i use the below code for XCSRF Token it give me undefined.
var UrlForGetTimeSheets =http://192.168.59.132:8080/gateway/odata/sap/EmployeeDataList;v=1/Timesheet('33');
OData.request
(
{
requestUri: UrlForGetTimeSheets,
method: "GET",
headers:
{
"X-Requested-With": "XMLHttpRequest",
"Accept": "application/atom+xml,application/atomsvc+xml,application/xml",
"Content-Type": "application/x-www-form-urlencoded",
"DataServiceVersion": "2.0",
"X-CSRF-Token":"Fetch"
}
},
function (data, response)
{
var header_xcsrf_token = response.headers['x-csrf-token'];
alert(response);
console.log(header_xcsrf_token);
}
);
Kindly give me the Solution.
Regard
Ali