【问题标题】:.net http Request using proxy 404 error not found.net http 请求使用代理 404 错误未找到
【发布时间】:2011-06-22 08:26:06
【问题描述】:

我正在使用 .net 桌面应用程序通过代理向我的网站发出 http 请求。 当我使用代理发出请求时,它适用于 http://www.mySite.com,但是当我尝试对例如 http://www.mySite.com/someSection 发出请求时,它返回 404 错误

当我在没有代理的情况下发出请求时,这两种情况都可以正常工作。

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(websiteURL);
                WebProxy proxy = new WebProxy(@"http://payforexsurf.info", false);
                request.Proxy = proxy;
                request.Method = "GET";
                request.KeepAlive = false;
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();

【问题讨论】:

    标签: .net http proxy


    【解决方案1】:

    我刚刚查看了他们的网站,但看不到他们在哪里将其宣传为可以以这种方式使用的代理服务。您的代码看起来确实正确,并且应该适用于适当的代理服务。我认为问题在于这个基于 Web 的“网页请求”服务不是一个合适的代理服务器。

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-06
      • 2021-01-05
      • 1970-01-01
      • 2023-01-05
      • 1970-01-01
      • 2019-10-14
      • 1970-01-01
      • 2020-07-21
      相关资源
      最近更新 更多