Spatacoli

WebClient Does not Send HTTP Headers By Default

Something to keep in mind as you are coding your Silverlight 2 Beta 2 applications is that the WebClient does not send any HTTP Headers by default. If you need some headers you must explicitly add them. For example, if you have a form you wrote in Silverlight and you need to post that data off to a web service or a POX page what you need to do is add something like this right after you initialize your WebClient (in this case the WebClient is called request):

request.Headers[HttpRequestHeader.ContentType] = 
     "application/x-www-form-urlencoded";

HTH