//
        // GET: /Home/
        //释迦苦僧 
        public ActionResult Index()
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri("http://localhost:12899/");
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            HttpResponseMessage response = client.GetAsync("api/task").Result;
            if (response.IsSuccessStatusCode)
            {
                var tasks = response.Content.ReadAsStringAsync();
                List<TaskInfoModel> p = JsonConvert.DeserializeObject<List<TaskInfoModel>>(tasks.Result);
                Console.Write(tasks.Result);
            }
            return View();
        }

 

相关文章:

  • 2021-09-30
  • 2022-12-23
  • 2021-12-04
  • 2021-04-06
  • 2021-09-02
  • 2021-12-10
  • 2021-09-21
猜你喜欢
  • 2022-02-19
  • 2021-06-18
  • 2022-03-10
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2021-04-16
相关资源
相似解决方案