/// <summary> /// データの更新 /// </summary> internal static void UpdateSheetData( string accessToken, string sheetId, Sheet.SheetProperties prop, string[,] param, string range, Action <PutSheet> success = null, Action <ErrorMessage> error = null) { var titleRange = $"\'{prop.title}\'!{range}"; var url = string.Format(SPREAD_SHEET_PUT_URL, sheetId, titleRange); var json = GoogleSpreadSheetUtil.ConvertPostJson(param, titleRange); var request = new UnityWebRequest(url, "PUT"); request.AddJson(json); request.SetAccessToken(accessToken); void Success() { var put = JsonUtility.FromJson <PutSheet>(request.downloadHandler.text); success?.Invoke(put); } request.Request(Success, error); }
/// <summary> /// AppScript へ Post リクエスト /// </summary> public static void PostAppsScript( string deployId, string json, Action <string> success = null, Action <ErrorMessage> error = null ) { var url = string.Format(APPS_SCRIPT_DEPLOY_URL, deployId); var request = new UnityWebRequest(url, "POST"); request.AddJson(json); void Success() { success?.Invoke(request.downloadHandler.text); } request.Request(Success, error); }