How to use beforeSend on every app.request?
Hi @arulraj
Try like this.
app.request({
url: wsUrl,
dataType: 'json',
data: data,
method: 'POST',
headers: header,
contentType: "application/json; charset=utf-8",
timeout:30000,
async:isAsync,
beforeSend:function() {
/This method will be called before webservice call initiate
},success: function(data, status, xhr) {
//Post request completed
},
error: function(xhr, status) {
//Error occured;
}
});
1 Like
app.request.setup({
beforeSend: function () {
//do something before every request sent
}
});
1 Like