草庐IT

ProtocolViolationException

全部标签

c# - System.Net.ProtocolViolationException : You must write ContentLength bytes to the request stream before calling [Begin]GetResponse

我得到了"System.Net.ProtocolViolationException:YoumustwriteContentLengthbytestotherequeststreambeforecalling[Begin]GetResponse"errorwhencallingtothe"BeginGetResponse"methodofthewebrequest.这是我的代码:try{StreamdataStream=null;WebRequestWebrequest;Webrequest=WebRequest.Create(this.EndPointAddress);Webrequ