Which method will trigger before app.request.post?

I need to check device online condition before calling service, for service call am using app.request.post. if have any method which will trigger before app.request.post so i can write my condition there instead of writing each service call.

Ex: For ajax we have ajax start methods.

I used below code. while offline am not getting value for window.navigator.onLine in before sent method.

app.request.setup({
	
  beforeSend() {
	  console.log(this);
	 console.log('before='+window.navigator.onLine); 
    if(!window.navigator.onLine){
		return false;
	}
  },
  complete() {
    console.log('complete123');
  },
})