Ive used HTTPWebRequest or WebRequest replete with all the stream readers and such to grab the HTML string of a web page. I was delighted to find the WebClient class which seems to encapsulate most that. I tried to implement it just now but needed to add headers for UserAgent and Accept. Doing it with HTTPWebRequest worked but not with WebClient. When I look at the headers in the WebClient object after setting them only the UserAgent was apparent and the count of the headers collection was 1. I read the documentation of WebCleint on the MSDN and it said that Accept and other headers are restricted. I think this means I cant set Accept to "text/html, application/xhtml+xml, */*". Can someone confirm my understanding and that I cant use WebClient in this case?
Also its my understanding that the default Accept header WebClient uses is text/HTML. Does this mean that if the object of my desires has programming on the HTML page it will not work? Which, in this case, it does.
Also its my understanding that the default Accept header WebClient uses is text/HTML. Does this mean that if the object of my desires has programming on the HTML page it will not work? Which, in this case, it does.