I just got this exception (ProtocolViolationException) in my .NET 2.0 app (running on windows mobile 6 standard emulator). What confuses me is that as far as i know, I have not added any content body, unless I've inadvertently done it somehow. My code is below (very simple). Is there anything else i need to do to convince .NET that this is just a http GET?
//run get and grab response
WebRequest request = WebRequest.Create(get.AbsoluteUri + args);
request.Method = "GET";
Stream stream = request.GetRequestStream(); // <= explodes here
XmlTextReader reader = new XmlTextReader(stream);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…