コード例 #1
0
 public static async Task <KeyValueProtocol> PostAsync(string url, KeyValueProtocol send)
 {
     try
     {
         return(new KeyValueProtocol(await HttpClient.PostAsync(url, send.GetString())));
     }
     catch (Exception)
     {
         var receive = new KeyValueProtocol();
         receive["status"] = "网络错误";
         receive["info"]   = "连接不到服务器 请检查网络";
         return(receive);
     }
 }
コード例 #2
0
ファイル: HttpSever.cs プロジェクト: ybbbby/IDG_FightServer
 public virtual KeyValueProtocol ParseReceive(KeyValueProtocol protocol)
 {
     protocol["time"] = DateTime.Now.ToString();
     return(protocol);
 }