コード例 #1
0
        public static async Task <HttpResponseMessage> SendRequest(HttpRequestMessage httpRequestMessage, CookieContainer cookieContainer)
        {
            int arg_54_0 = 0;

            httpRequestMessage.RequestUri.AbsoluteUri.IndexOf("partslink24.com");
            HttpResponseMessage result;

            if (arg_54_0 != 0)
            {
                HttpProxyServer.ConfigureMessageHeaders(httpRequestMessage);
                using (HttpClient httpClient = new HttpClient(HttpProxyServer.CreateClientHandler2(cookieContainer), true))
                {
                    httpClient.BaseAddress = httpRequestMessage.RequestUri;
                    result = await httpClient.SendAsync(httpRequestMessage);

                    return(result);
                }
            }
            HttpProxyServer.ConfigureMessageHeaders(httpRequestMessage);
            using (HttpClient httpClient2 = new HttpClient(HttpProxyServer.CreateClientHandler(cookieContainer), true))
            {
                httpClient2.BaseAddress = httpRequestMessage.RequestUri;
                result = await httpClient2.SendAsync(httpRequestMessage);
            }
            return(result);
        }
コード例 #2
0
ファイル: HttpProxyServer.cs プロジェクト: 15831944/Avtoritet
        public static async Task <HttpResponseMessage> SendRequest(HttpRequestMessage httpRequestMessage, CookieContainer cookieContainer)
        {
            int arg_54_0 = 0;
            //httpRequestMessage.RequestUri.AbsoluteUri.IndexOf(string.Format("{0}.com", ResourceManager.Urls[CatalogApi.UrlConstants.Key.Partslink24Root]));

            HttpResponseMessage result;

            if (arg_54_0 != 0)
            {
                HttpProxyServer.ConfigureMessageHeaders(httpRequestMessage);
                using (HttpClient httpClient = new HttpClient(HttpProxyServer.CreateClientHandler2(cookieContainer), true))
                {
                    httpClient.BaseAddress = httpRequestMessage.RequestUri;
                    result = await httpClient.SendAsync(httpRequestMessage);

                    return(result);
                }
            }

            HttpProxyServer.ConfigureMessageHeaders(httpRequestMessage);
            using (HttpClient httpClient2 = new HttpClient(HttpProxyServer.CreateClientHandler(cookieContainer), true))
            {
                httpClient2.BaseAddress = httpRequestMessage.RequestUri;
                result = await httpClient2.SendAsync(httpRequestMessage);
            }

            return(result);
        }