Hi Experts,
I have question about CRUD function.
When we are use CREATE, PUT ant DELETE, Should I call GET method every times?
for example
OData.request({
requestUri :
method : "GET",
headers : {
"X-Requested-With" : "XMLHttpRequest",
"Content-Type" : "application/atom+xml",
"DataServiceVersion" : "2.0",
"X-CSRF-Token" : "Fetch"
}
},
function(data, response) {
header_xcsrf_token = response.headers['x-csrf-token'];
var oHeaders = {
"x-csrf-token" : header_xcsrf_token,
'Accept' : 'application/json',
};
OData.request({
requestUri :
method : "DELETE",
headers : oHeaders,
data:oEntry
},
function(data,request) {
alert("Delete Success");
location.reload(true);
}, function(err) {
alert("Delete Failed");
});
}, function(err) {
var request = err.request;
var response = err.response;
alert("Error in Get -- Request " + request + " Response " + response);
});
if answer is yes, please explain the reason.
and if answer is no, please explain the other way .
Thank you!!