'c#: How to retrieve how much time is left before a timeout for an HTTP request in WebAPI operation method?

In a WebAPI controller method I want to calculate the time left before request timeout. But I cannot find the property to retrieve the timeout, so I could calculate.

I'm using .NET 6, and my controller extends to ControlerBase.

How to tackle that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source