Last post Sep 16, 2015 05:01 AM by jmpalines
Sep 14, 2015 02:40 PM|uid829402|LINK
I'm running into issues when calling my Web API that is hosted on our app server,
On my web server, I have an HTM page that calls the WebAPI and when I call it from the web server as such:
http://localhost:2020/testSite/servicecall.htm it works
when I call the page as:
http://servername:2020/testSite/servicecall.htm it fails
what would cause localhost to work and not the actual servername in the URL?
both web servers are Windows 2012 Servers.
Sep 14, 2015 11:04 PM|Li Wang|LINK
Did you call the two html pages in the same machine and could you show any error messages when you use servername?
Sep 15, 2015 07:07 AM|uid829402|LINK
Yes, there are no error messages returned to me. I ran dev tools and saw now errors coming back
Sep 16, 2015 01:29 AM|Li Wang|LINK
According to your description, your web api can't be invoke from the same computer use hostname? It can be access by other computer. By check the another thread, I saw your web api url is
http://servername:2020/api/GetJobs. I suggest you change your web api url to IP address format. like this
Sep 16, 2015 05:01 AM|jmpalines|LINK
try running fiddler to see if there is any error for the request,
also check your config regarding proxy settings