我正在尝试向API发出POST请求,但最终会超时。如果我通过代理运行它,它按预期工作,所以我不知道如何找出去哪里。
string url = "https://" + this.Host + ":1234" + uri;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
//request.Proxy = new WebProxy ("127.0.0.1", 8080);
request.ContentType = "application/json";
string response = string.Empty;
try
{
using (StreamReader reader = new StreamReader(request.GetResponse().GetResponseStream()))
response = reader.ReadToEnd();
}