Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I specify a global HttpWebRequest timeout?

I'm using a twitter library that uses HttpWebRequest internally to make requests to the twitter API. For some odd reason, the requests sometimes take a lot of time to complete (~10 minutes).

The HttpWebRequest object is not exposed by the library.

Is there any way to specify a global timeout and readwritetimeout for the requests, perhaps via app.config?

like image 880
imlokesh Avatar asked Sep 07 '14 13:09

imlokesh


1 Answers

Unfortunately not currently possible. The constructor of HttpWebRequest has this value hardcoded - reference source.

like image 140
Iain Avatar answered Sep 27 '22 18:09

Iain