0
我有一個生成XML的php服務。我如何解析C#中的XML?我試圖用這樣的:Windows Phone 8 Web請求異步調用XML
WebRequest request = WebRequest.Create("http://devstage.jokeroo.com/rest.php");
request.Method = "GET";
request.ContentType = "text/html";
IAsyncResult result = request.BeginGetResponse(RequestCallback, request);
private void RequestCallback(IAsyncResult ar)
{
var request = ar.AsyncState as WebRequest;
Stream reader = request.EndGetResponse(ar).GetResponseStream();
//use this reader to read the content
}
但它不斷拋出此異常:
'System.Net.ProtocolViolationException'
類型的異常出現在System.Windows.ni.dll
但在用戶代碼
任何建議沒有處理?