The WebClient Headers property is missing. Add method?

In .NET (for Windows Phone) I am trying to use the WebClient class to send XML to a web service. In the examples I found, add the headers using the Add method, but I get an error that the Add method was not found:

using System.Net; ... WebClient wc = new WebClient(); wc.Headers.Add(HttpRequestHeader.ContentType, "text/xml"); 

Am I just skipping the link somewhere or was it changed? I also do not have the specified Set method.

+4
source share
1 answer

wc.Headers ["ContentType"] = "text / xml";

+3
source

All Articles