验证中...
开源中国 2018 年度最后一场技术盛会邀你来约~错过就要等明年啦!点此立即预约
语言: C#
分类: 网络技术
最后更新于 2018-12-09 10:07
Request Code
原始数据 复制代码
HttpClient httpClient = new HttpClient();
httpClient.Timeout = TimeSpan.FromSeconds(60);
httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
//Get Request
var res1 = httpClient.GetStringAsync(url).Result.ToString();
//Post Request
var json = JsonConvert.SerializeObject(model);
var response = httpClient.PostAsync(url,new StringContent(json)).Result;
var res2 = response.Content.ReadAsStringAsync().Result;

评论列表( 0 )

你可以在登录后,发表评论

搜索帮助