0

我想使用代理从外部 url 获取 json 字符串。

我需要设置什么设置才能使用代理访问 url?

这是我的示例代码:

        WebClient myWebClient = new WebClient();
        Response.Write(myWebClient.DownloadString(@"http://www.otherwebsite.com:11111/json.aspx"));

然后我收到一个错误,启用连接到远程服务器,但如果我删除代理它可以访问并将 json 返回给我。

有什么资料提供给我吗?

4

1 回答 1

1

删除 URL 中的端口号后,您得到了有效的响应。这表明 Web 服务器正在侦听端口 80 而不是端口号 11111

于 2012-05-04T10:18:51.363 回答