Let's say I have a service that makes HTTP requests to my API and returns observables - usual case.
I use that service, but the user gets impatient and decide to cancel that request, using my-subscription.unsubscribe(). It is even possible that the request will cancel itself, using observable.timeout().
So the user will not receive the API's response, but it is possible that the API still received his request and treated it, without noticing him.
Is there a method in httpclient that allow me to cancel an HTTP request, but being sure that the server will not receive the request after the cancellation ?
In my case, i have a post request which may take an indeterminate amount of time. I need to be able to cancel a request BUT it's very important to not process the request if the user cancelled it. Another solution is to process the request but notify the user that the server processed it even if he unsubscribed.
Is it possible to get this behavior without using websockets ?
Thanks a lot.