,當我面臨的一個非常奇怪的問題連接到遠程服務器:無法觸及的API
案例1:使用ASP.NET Web開發服務器:應用擊中API,和一切工作正常。
案例2:我在IIS主機我的應用程序(MVC):當應用程序試圖打API,它得到的錯誤:
"Unable to connect to remote server": {"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 96.17.180.160:80"}
的代碼行:
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(api);
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); // This line breaks...
看來IIS服務器不能訪問。你是否嘗試過從服務器ping IP?您是否嘗試通過瀏覽器或服務器的telnet連接到它? – leppie
是的我試圖通過瀏覽器連接到該API,它工作正常。 – Jash
代理設置可能嗎? – leppie