protected HttpResponseMessage SendJsonRequest(HttpClient client, string jsonRequest)
{
var mediaType = "application/json";
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(mediaType));
return client.PostAsync(ApiUrl, new StringContent(jsonRequest, Encoding.UTF8, mediaType)).Result;
}
错误是任务被取消,它是否与Api相关或将来自我的代码?
1条答案
按热度按时间kzmpq1sx1#
您没有等待
PostAsync
。