0

When we are hitting a button on our angualr app a specific http request should be canceled. We are trying to achive this be calling .unsubscribe() in our app.

Inside the web dev tools we can see that the request is marked as canceled, but the CancellationToken on our ASP.Net backend won't be set to IsCancellationRequested = true

Tests with postman works as expected and also after refreshing our swagger page after calling the request will set IsCancellationRequested to true

As i'm responsible only for the backend i don't know much about the frontend implementation. Please let me know if i should provide more information.

We are working with .net 6 and angular v13.

Does anyone have an idea, why the CancellationToken doesn't get canceled in this szenario. I already searched a lot, but no solution worked for us.

Thomas Meinhart
  • 659
  • 2
  • 7
  • 28
  • Can you provide a sample of code of the calling component ? – Alex Jul 01 '22 at 10:34
  • check any of given solution [here](https://stackoverflow.com/questions/57746297/how-to-cancel-net-core-web-api-request-using-angular) works for you ? – CodingMytra Jul 01 '22 at 12:05
  • As i said, i'm not the developer of the frontend, but i will try to get a sample code. Meanwhile our frontenddev setup a dummy angular app and it seems like it is working as expected with that. So there must be an issue with our current app setup. – Thomas Meinhart Jul 01 '22 at 14:13

0 Answers0