Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Portable Class Library and HttpWebRequest.UserAgent

$
0
0

In my W8/WP8 portable class library the user agent of HttpWebRequest is always null. Since the target server requires a user agent I cannot get my code to work as a portable class library.

I tried to set request.Headers[HttpRequestHeader.UserAgent] but it fails with an exception "The 'User-Agent' header must be modified using the appropriate property or method.\r\nParameter name: name".

The HttpWebRequest does not have a property called UserAgent! Is there any other way to set the user agent of my webrequest?

thanks

Steffen


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>