コード例 #1
0
ファイル: HttpClient.cs プロジェクト: kiichi54321/Rawler
        public string HttpGet(string url, List <KeyValue> parameterList, List <KeyValue> httpHeaderList)
        {
            this.Sleep();
            if (ReportUrl)
            {
                ReportManage.Report(this, "GET " + url, true, true);
            }
            System.Net.Http.HttpClient client = GetHttpClient();

            client.SetHeader(httpHeaderList);
            var result = client.GetStringAsync(url).ConfigureAwait(false).GetAwaiter().GetResult();

            client.RemoveHeader(httpHeaderList);

            return(result);
        }