Headlines feed. ETF Feed.
This commit is contained in:
@@ -1062,7 +1062,8 @@ namespace MarketData.Integration
|
||||
MDTrace.WriteLine(LogLevel.VERBOSE, "GetRequestNoEncodingV6[LEAVE]");
|
||||
}
|
||||
}
|
||||
public static HttpNetResponse GetRequestNoEncodingV7(String strRequest)
|
||||
|
||||
public static HttpNetResponse GetRequestNoEncodingV7(String strRequest,WebProxy webProxy=null,CookieCollection cookieCollection=null)
|
||||
{
|
||||
HttpWebResponse webResponse = null;
|
||||
try
|
||||
@@ -1076,6 +1077,7 @@ namespace MarketData.Integration
|
||||
ServicePointManager.Expect100Continue = true;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(new Uri(strRequest));
|
||||
if(null!=webProxy)webRequest.Proxy=webProxy;
|
||||
webRequest.KeepAlive=true;
|
||||
webRequest.Headers.Add("Accept-Language: en-US,en;q=0.5");
|
||||
webRequest.Headers.Add("Accept-Encoding: gzip, deflate, br");
|
||||
@@ -1084,6 +1086,7 @@ namespace MarketData.Integration
|
||||
webRequest.UserAgent = " Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0";
|
||||
webRequest.KeepAlive = true;
|
||||
webRequest.CookieContainer = new CookieContainer();
|
||||
if(null!=cookieCollection)webRequest.CookieContainer.Add(cookieCollection);
|
||||
webResponse = (HttpWebResponse)webRequest.GetResponse();
|
||||
Stream responseStream = webResponse.GetResponseStream();
|
||||
if (webResponse.ContentEncoding.ToLower().Contains("gzip"))
|
||||
@@ -1151,12 +1154,16 @@ namespace MarketData.Integration
|
||||
webRequest.Headers.Add("Sec-Fetch-Mode:cors");
|
||||
webRequest.Headers.Add("Sec-Fetch-Site:same-site");
|
||||
webRequest.Headers.Add("X-SAL-ContentType:e7FDDltrTy+tA2HnLovvGL0LFMwT+KkEptGju5wXVTU=");
|
||||
webRequest.Headers.Add("X-API-RequestId: 4b919fb3-6dc8-750d-e50f-639f73030527");
|
||||
// webRequest.Headers.Add("X-API-RequestId: 4b919fb3-6dc8-750d-e50f-639f73030527");
|
||||
webRequest.Headers.Add("X-API-RequestId: d2ffea42-4a07-4fa7-fa0d-b307facd81fb");
|
||||
webRequest.Headers.Add("ApiKey:lstzFDEOhfFNMLikKa0am9mgEKLBl49T");
|
||||
webRequest.Accept = "*/*";
|
||||
webRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0";
|
||||
// webRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0";
|
||||
webRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36";
|
||||
webRequest.Host="api-global.morningstar.com";
|
||||
webRequest.Referer="https://www.morningstar.com";
|
||||
// webRequest.Referer="https://www.morningstar.com";
|
||||
webRequest.Referer="https://www.morningstar.com/stocks/xnas/aapl/performance";
|
||||
|
||||
if(null!=webProxy)webRequest.Proxy=webProxy;
|
||||
|
||||
webRequest.CookieContainer = new CookieContainer();
|
||||
|
||||
Reference in New Issue
Block a user