Reputation: 35
I am trying to set the Timeout on an HttpWebRequest and it seems that it is not possible in .Net Core. The property 'Timeout' is no longer there.
Thanks
Upvotes: 2
Views: 2298
Reputation: 141572
I am trying to set the Timeout on an HttpWebRequest and it seems that it is not possible in .Net Core.
It is possible in .NET Core if you are using .NET Core 2.0. You can see the support for the Timeout
property here.
If you can, use the System.Net.Http.HttpClient instead, because...
In general, for better app performance and features, we recommend developers move away from HttpWebRequest and adopt HttpClient API surface.
Upvotes: 3