Skip to main content
edited tags
Link
RickNZ
  • 18.7k
  • 3
  • 54
  • 67
formatted
Source Link
tvanfosson
  • 534k
  • 102
  • 703
  • 801

I am working on a ASP .NET mVC project & i have to change HttpHeaders. see the foolowing code snippet:

WebRequest req= HttpWebRequest.Create("myURL");
         HttpWebResponse response = (HttpWebResponse)request.GetResponse();

req.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)");
             req.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
             req.Headers.Add("Accept-Language", "en-us,en;q=0.5");

this gives a exception i.e. This header must be modified using the appropriate property.\r\nParameter name: name.

This header must be modified using the appropriate property.\r\nParameter name: name.

Anyone suggets solution for it

I am working on a ASP .NET mVC project & i have to change HttpHeaders. see the foolowing code snippet:

WebRequest req= HttpWebRequest.Create("myURL");
         HttpWebResponse response = (HttpWebResponse)request.GetResponse();

req.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)");
             req.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
             req.Headers.Add("Accept-Language", "en-us,en;q=0.5");

this gives a exception i.e. This header must be modified using the appropriate property.\r\nParameter name: name. Anyone suggets solution for it

I am working on a ASP .NET mVC project & i have to change HttpHeaders. see the foolowing code snippet:

WebRequest req= HttpWebRequest.Create("myURL");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

req.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)");
req.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
req.Headers.Add("Accept-Language", "en-us,en;q=0.5");

this gives a exception i.e.

This header must be modified using the appropriate property.\r\nParameter name: name.

Anyone suggets solution for it

Format codes
Source Link
o.k.w
  • 25.9k
  • 6
  • 68
  • 64

I am working on a ASP .NET mVC project & i have to change HttpHeaders. see the foolowing code snippet:

WebRequest req= HttpWebRequest.Create("myURL"); HttpWebResponse response = (HttpWebResponse)request.GetResponse();

req.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)"); req.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"); req.Headers.Add("Accept-Language", "en-us,en;q=0.5");

WebRequest req= HttpWebRequest.Create("myURL");
         HttpWebResponse response = (HttpWebResponse)request.GetResponse();

req.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)");
             req.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
             req.Headers.Add("Accept-Language", "en-us,en;q=0.5");

this gives a exception i.e. This header must be modified using the appropriate property.\r\nParameter name: name. Anyone suggets solution for it

I am working on a ASP .NET mVC project & i have to change HttpHeaders. see the foolowing code snippet:

WebRequest req= HttpWebRequest.Create("myURL"); HttpWebResponse response = (HttpWebResponse)request.GetResponse();

req.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)"); req.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"); req.Headers.Add("Accept-Language", "en-us,en;q=0.5");

this gives a exception i.e. This header must be modified using the appropriate property.\r\nParameter name: name. Anyone suggets solution for it

I am working on a ASP .NET mVC project & i have to change HttpHeaders. see the foolowing code snippet:

WebRequest req= HttpWebRequest.Create("myURL");
         HttpWebResponse response = (HttpWebResponse)request.GetResponse();

req.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)");
             req.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
             req.Headers.Add("Accept-Language", "en-us,en;q=0.5");

this gives a exception i.e. This header must be modified using the appropriate property.\r\nParameter name: name. Anyone suggets solution for it

Source Link
d k
  • 493
  • 2
  • 6
  • 21
Loading