HttpClient Get与Post请求数据
2021-04-19 22:27
标签:header cat success stat exception ast headers throw pre 直接干货: Post 或者如下调用: HttpClient Get与Post请求数据 标签:header cat success stat exception ast headers throw pre 原文地址:https://www.cnblogs.com/Fengge518/p/12266911.htmlpublic class HttpClientHelper
{
//
try
{
System.Net.Http.HttpClient httpClient = new System.Net.Http.HttpClient();
var values = new Dictionarystring, string>
{
{ "cou_id", "A9E52C76-0CE7-4261-54C3-7EB04062F758" }
};
var content = new System.Net.Http.FormUrlEncodedContent(values);
var response = httpClient.PostAsync("http://localhost:8888/Api/Course/GetCourseStudent", content).Result;
var responseString = response.Content.ReadAsStringAsync().Result;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
上一篇:03. 选择器补充及CSS动画
下一篇:xml数据转Json
文章标题:HttpClient Get与Post请求数据
文章链接:http://soscw.com/index.php/essay/76848.html