Update user agent and add new get method.

This commit is contained in:
2024-04-08 13:46:37 -04:00
parent 4b8d38ab48
commit dbc1267731
2 changed files with 1 additions and 68 deletions

View File

@@ -1027,9 +1027,8 @@ namespace MarketData.Integration
if(null!=webProxy)webRequest.Proxy=webProxy;
webRequest.Timeout = webRequestTimeoutMS;
webRequest.Headers.Add("Accept-Language: en-US,en;q=0.5");
webRequest.Headers.Add("Accept-Encoding: None");
webRequest.Headers.Add("Accept-Encoding: *");
webRequest.Accept = "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
// if(useRandomUserAgent)webRequest.UserAgent=GetUserAgent();
if (useRandomUserAgent) webRequest.UserAgent = UserAgent.GetInstance().GetUserAgent();
else webRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; .NET4.0C; .NET4.0E; InfoPath.3)";
webRequest.KeepAlive = true;