I created a default Blazor WASM ASP.NET hosted app.
On WeatherForecastController Get method i added the parameter CancellationToken cancellationToken:
[HttpGet] public IEnumerable<WeatherForecast> Get(CancellationToken cancellationToken)
Now, from client the http call is Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast", CancellationToken.None) so i expect on server side who the property cancellationToken.CanBeCanceled is false BUT the property is true!
I also tried:
Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast") or Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast", default(CancellationToken))
but on server the CanBeCanceled property is always true
Why?
How to have a default cancellationToken with CanBeCanceled = false?
Thanks