- Home /
Question by
sonalichalke · Oct 10, 2017 at 08:09 AM ·
hosthttpwebrequestheaders
How to change Host name in HttpWebRequest headers in unity .net 2.0?
I want to call a webpage by its ip address by adding custom values to request header for "host". "
" Code:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://1.1.1.1");
request.Headers["Host"] = "xyz.net";
WebResponse response = request.GetResponse();
But it gives an error: ArgumentException: restricted header
it seems that some headers cannot be modified in .net 2.0 so is there any way that i can change the host or change the .net version in unity to higher version?
Comment