Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing Request Timeout in Asp.net WebAPI

I have an ASP.net web api that is timing out request at around ~100 seconds. One of my action methods needs more time to complete a request.

After going over various link, I have already figured out that the following will not work

a) executionTimeout & ScriptTimeout as request pipeline is completely asynchronous and those values were for synchronous pipeline back then.

b) [AsyncTimeout(seconds)] attribute as it applies only for MVC web applications and ASP web api does not reference system.web.mvc

Is there any other approach on controlling timeout for this scenario?

like image 514
Frank Q. Avatar asked Oct 20 '25 13:10

Frank Q.


1 Answers

Appears that there is no timeout enforced on Web API. The timeout was happening on client side. After changing the HttpClient.Timeout value it worked.

like image 118
Frank Q. Avatar answered Oct 22 '25 03:10

Frank Q.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!