How to keep a connection open with httpClient and avoid timeout?

I have a method that sends a file to the backend and waits for the response.
It is a massive import.
However the backend takes a long time to make the import, so I have a timeout error on the client side.

    return<any>(myUrl,  formData,
        {headers: this.getFormMultipartHeader(), responseType: 'json'});

Which is the right way to do this, according to you?

Thank you very much


I don’t believe Angular HttpClient has an internal timeout, so how are you generating it? Do you have some sort of proxy configuration set up, for example?

I suppose how to proceed would depend on what “a long time” is and what the user can do in the meantime. One option would be to have the server respond asynchronously via a push notification.

1 Like