更清楚
public void myFunc(string url, object obj) {
var client = new HttpClient();
client.PostAsync(url,obj);
}
如果我想使用SendAsync重新创建该代码,我该怎么做?
public void myFunc(string url, object obj) {
var client = new HttpClient();
var request = new HttpRequestMessage() {
RequestUri = new Uri(url),
Method = HttpMethod.Post,
Content = ??
};
client.SendAsync(request);
}
我不清楚在这种情况下PostAsync会做什么