public MiddleResult Get(string middleUrl, IDictionary <string, object> middleParam) { //1.获取httpclient HttpClient httpClient = httpClientFactory.CreateClient(HttpConst); //2.参数转化为url string urlparam = HttpParamUtil.DicToHttpUrlParam(middleParam); //2.Get HttpResponseMessage httpResponseMessage = httpClient.GetAsync(middleUrl + urlparam).Result; return(GetMiddleResult(httpResponseMessage)); }
public MiddleResult Get(string middleUrl, IDictionary<string, object> middleParam) { // 1、获取httpClient HttpClient httpClient = httpClientFactory.CreateClient(HttpConst); // 2、参数转换为url方式 string urlParam = HttpParamUtil.DicToHttpUrlParam(middleParam); // 3、Get请求 HttpResponseMessage httpResponseMessage = httpClient.GetAsync(middleUrl + urlParam).Result; return GetMiddleResult(httpResponseMessage); }