【发布时间】:2021-10-03 12:27:58
【问题描述】:
我的 xamarin 代码有 System.Net.WebException: '在 WebClient 请求期间发生异常。'错误
NameValueCollection postCollection = new NameValueCollection();
postCollection.Add("q", city);
postCollection.Add("appid", ApiKey);
WebClient postClient = new WebClient();
var postResult = postClient.UploadValues(
"https://samples.openweathermap.org/data/2.5/weather",
"GET",
postCollection); //this line has error
【问题讨论】:
-
您需要检查 Exception 对象以确定根本原因是什么
标签: c# api xamarin system.net.webexception