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); } }
public virtual KeyValueProtocol ParseReceive(KeyValueProtocol protocol) { protocol["time"] = DateTime.Now.ToString(); return(protocol); }