We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to intercept XHR http call in angular


I want to intercept ajax calls in file manager to retry same operation in case if it is failed for certain http code. is it possible to do it? 



2 Replies

SS Sivakumar ShunmugaSundaram Syncfusion Team January 9, 2023 04:19 PM UTC

Hi sathiya,

Greetings from Syncfusion support.

With the shared details, you need to intercept ajax calls in the FileManager to retry the same operation in case it is failed for a certain http code. In our FileManager component, you can be able to capture every ajax request using FileManager beforeSend event and also can be able to capture the FileManager ajax requests failure using the FileManager failure event. Using the mentioned event, you can be able to make your own customization in the FileManager component.

Refer to the below code snippet.



<div class="sample-container">
















export class AppComponent {


    public fileObj: FileManagerComponent;


    failure(args) {


      //Here you can make your customization while ajax request fails



    onbeforeSend(args) {


      //Here you can find the every ajax request in the FileManager componnent





Sample: https://stackblitz.com/edit/angular-oqb6mk-nffhxp?file=app.component.ts

Check the shared sample for your reference.

SA sathiya replied to Sivakumar ShunmugaSundaram January 13, 2023 02:45 PM UTC

thank you

Live Chat Icon For mobile
Up arrow icon