I have a .NET program running on Ubuntu via Mono 2.10
The program downloads a webpage via an HttpWebRequest every minute or so which works fine most of the time:
You can solve it by translating the host name to ip and add the host name to Headers
collection or to Host
property.
If your url is http://example.com/uri
. Resolve the host yourself. Suppose its 1.2.3.4
. It'll be http://1.2.3.4/uri
. Now add Host: example.com
header to your request. I think it can be done by setting HttpWebRequest.Host
property.