本文整理汇总了C#中WebRequest.dumpRequest方法的典型用法代码示例。如果您正苦于以下问题:C# WebRequest.dumpRequest方法的具体用法?C# WebRequest.dumpRequest怎么用?C# WebRequest.dumpRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebRequest
的用法示例。
在下文中一共展示了WebRequest.dumpRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: reqFinished
//private ->public
public virtual void reqFinished(WebRequest req)
{
if (req.www.error != null) {
Debug.LogError (" req error:" + req.dumpRequest());
} else {
Hashtable t = MiniJsonExtensions.hashtableFromJson (req.www.text);
if (t == null) {
Debug.LogError ("http call return empty");
this.onError("Null HashTable","Null HashTable",null);
return;
}
// {"protocolVersion":1,"serverTime":"2013-11-29 15:24:42,727","serverTimestamp":1385709882,"data":[{"requestId":null,"messages":{},"result":"aWeha_JMFgzaF5zWMR3tnObOtLZNPR4rO70DNdfWPvc.eyJ1c2VySWQiOiIyMCIsImV4cGlyZXMiOiIxMzg1NzA5ODgyIn0","status":0}]}
ArrayList datas = t["data"] as ArrayList;
if(datas == null || datas.Count != 1){
Debug.LogError ("http call return no data");
this.onError("Null Data","Null Data",null);
return;
}
Hashtable data = datas[0] as Hashtable;
string status = "" + data ["status"];
Hashtable result = data["result"] as Hashtable;
if(result == null && data["result"] is string){
result = data;
}
if(result!=null)Debug.Log (Utils.dumpHashTable (result));
if (status != "0" ) {
Debug.LogError ("status=" + status );
onError (status, status, result);
} else{
onComplete(result);
}
}
}
示例2: reqFinished
//private ->public
public override void reqFinished(WebRequest req)
{
if (req.www.error != null) {
Debug.LogError (" req error:" + req.dumpRequest());
} else {
Hashtable h = new Hashtable();
h.Add("text",req.www.text);
onComplete(h);
}
}