我需要从我的MVC应用程序中获取外部网站的http目录列表。
以下在控制台应用程序中正常工作:
string url = "http://nemweb.com.au/Reports/Current/TradingIS_Reports/";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
但返回“”远程服务器返回错误:(503)服务器不可用。“从我的PC上的Visual Studio调试中的MVC应用程序运行时。
我在MVC应用程序中使用身份模拟。
任何帮助非常感谢。
我在客户端(失眠)请求成功,req-res时间表如下:
> GET /Reports/Current/TradingIS_Reports/ HTTP/1.1
> Host: nemweb.com.au
> User-Agent: insomnia/6.0.2
> Accept: */*
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: http://www.nemweb.com.au
< Content-Type: text/html; charset=UTF-8
< Date: Thu, 13 Sep 2018 06:38:57 GMT
< Server: Microsoft-IIS/8.5
< Content-Length: 138681
< Connection: keep-alive
似乎不是服务器限制。这是偶然的失败吗?