public static void OnWebRequest(string reqUrl, string content , Action <JObject> onSuccess = null, Action <string> onFail = null, Action <string> onErr = null) { UWebSender.OnRequest(Utils.BaseURL + reqUrl, content, (res) => { var jres = res; var err = jres["err"].ToString(); if (err == "0") { onSuccess?.Invoke(jres); } else { onFail?.Invoke(err); } }, (err) => { onErr?.Invoke(err); }); }
public static void OnWebRequest(string reqUrl, string content , Action <JObject> onSuccess = null, Action <string> onFail = null, Action <string> onErr = null) { UWebSender.OnRequest(Utils.BaseURL_APIs + reqUrl, content, (res) => { var jres = res; var err = jres["err"].ToString(); if (err == "0") { onSuccess?.Invoke(jres); if (jres.ContainsKey("avatar") && jres["avatar"] != null) { URemoteData.OnReceiveAvatarData(jres["avatar"]); } } else { onFail?.Invoke(err); } }, (err) => { onErr?.Invoke(err); }); }