1. 程式人生 > >httpClient簡單應用

httpClient簡單應用

string urlPath = ConfigurationManager.AppSettings["urlPath"] + "?AFFAIRID=" + affairguide.AFFAIRID;
HttpClient client = new HttpClient();
string response = client.GetStringAsync(urlPath).Result;
if (response != "")
 {
          return "error";
}