Configure request timeout for WebApi controllers
asp.net-web-api2, c#
Solution
Good question, I would recommend to handle this from client side - you can always specify timeout settings in your consumer code, even if it is ajax:
$.ajax({
url: "/ajax_json_echo/",
timeout: 1000,
...
Problem
I'm using async methods in my WebAPi controllers: ``` public async Task<HttpResponseMessage> SampleMethod(int subscriptionNumber, DateTime departureDate) { // [...] } ``` How do I configure the request timeout? The operation can take up to a couple of minutes and I have to make sure that the request do not timeout. In MVC there is an attribute called `[AsyncTimeout]`. Are there an equivalent in WebApi? Can it be configured globally?