Hi all,
I've a tricky problem using HttpWebRequest to place a GET request.
In my hosts file I defined some names for few IP addresses that are on a local Network adapter.
127.0.0.1 localhost
192.168.254.1 xs.pc
192.168.253.1 xs.card
127.0.0.1 xs.simu
If in my request I give the IP address it works normally, however if I give the alias name, like xs.pc, it doesn't work. The device never gets the packets.
The line of code looks like this:
HttpWebRequest httpRequest = (HttpWebRequest) HttpWebRequest.Create(new Uri("http://xs.pc/ewd/login/all")); -> Doesn't work HttpWebRequest httpRequest = (HttpWebRequest) HttpWebRequest.Create(new Uri("http://192.168.252.1/ewd/login/all")); -> Does worklocalhost seems different because even if I remove it, it still works!!
What I don't understand is that it works with the ping command, the browser or an XmlHttpRequest placed from a Firefox toolbar.
I searched in the HttpWebRequest class but I didn't find anything to configure this.
Does anyone knows how to fix this problem
Thks by advance
Olivier