验证中...
Languages: C#
Categories: 网络技术
Latest update 2018-12-09 10:07
Request Code
Raw Copy
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;

Comment list( 0 )

You need to Sign in for post a comment

Help Search