学海无涯

导航

HttpClient

 var httpClient = new HttpClient();
            var url = new Uri("http://localhost:57679/api/Technology/All");
            var response = httpClient.GetAsync(url).Result;
            if(response.StatusCode == System.Net.HttpStatusCode.OK)
            {

            }
            var data = response.Content.ReadAsStringAsync().Result;
            textBox1.Text = data;
            var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Technology>>(data);
            gridControl1.DataSource = list;

  

posted on 2023-09-01 09:03  宁静致远.  阅读(17)  评论(0编辑  收藏  举报