我有这段代码:
在调试模式下,该代码在这个阶段不会产生任何响应,没有错误代码但停止运行:
using (var client = new HttpClient())
{
var values = new Dictionary<string, string>
{
{"site_id","001"},
{"apikey","abc01201az1024"},
{"trans_id","45364136"},
};
// Get the parameters in the url encoded format
var content = new FormUrlEncodedContent(values);
//Send request
var response = await client.PostAsync(url, content);
DataRoot<Transaction> outPut = null;
if (response.IsSuccessStatusCode)
{
//Get Response
var result = await response.Content.ReadAsStringAsync();
JsonConvert.DeserializeObject<DataRoot<Transaction>>(result);
}
return outPut;
}
在调试模式下,该代码在这个阶段不会产生任何响应,没有错误代码但停止运行:
//Send request
var response = await client.PostAsync(url, content);