This video shows how the HttpClient class behaves differently when timing out in .Net Framework v/s .Net 6.
First of all, it is not throwing the TimeoutException but TaskCancelledException.
In .Net Framework it throws TaskCancelledException without any timeout details except the IsCancellationRequested property.
In .Net core 3.1 onwards it is throwing TaskCancelledException with TimeoutException in its inner exception property. Also, the message clearly indicates the TaskCancelled due to timeout.
More details are available in the GitHub issue discussion about this change.
https://github.com/dotnet/runtime/iss...
Sample can be downloaded from https://github.com/dotnet-demos/httpc...