/// <summary> /// This might not work /// </summary> /// <param name="url"></param> /// <param name="obj"></param> /// <returns></returns> public virtual int Delete(string url, ICreateFormData obj) { UnityWebRequest www = UnityWebRequest.Put(url, JsonUtility.ToJson(obj)); www.method = UnityWebRequest.kHttpVerbDELETE; www.SetRequestHeader("Content-Type", "application/json"); www.SendWebRequest(); while (!www.isDone) { if (www.downloadProgress < threshold) { Thread.Sleep(sleepTime); } } int outputInt; if (int.TryParse(www.downloadHandler.text, out outputInt)) { return(outputInt);//output the parsed integer } else { Debug.Log("Error From Delete API return type was not int:\n" + www.downloadHandler.text); return(-1);//output error message } }
public int Delete(ICreateFormData obj, bool removeAll = false) { if (removeAll) { Temp temp = new Temp(); temp.aList = obj.CreateForm(); temp.aList.Add(new MultipartFormDataSection("Remove_All", true.ToString())); return(base.Delete(URLConfig.BASEURL + baseTable, temp)); } else { return(base.Delete(URLConfig.BASEURL + baseTable, obj)); } }
/// <summary> /// This might not work /// </summary> /// <param name="url"></param> /// <param name="obj"></param> /// <returns></returns> public virtual string Put(string url, ICreateFormData obj) { UnityWebRequest www = UnityWebRequest.Put(url, JsonUtility.ToJson(obj)); www.method = "PUT"; www.SetRequestHeader("Content-Type", "application/json"); www.SendWebRequest(); while (!www.isDone) { if (www.downloadProgress < threshold) { Thread.Sleep(sleepTime); } } return(www.downloadHandler.text); }
public Association Put(ICreateFormData obj) { return(JsonUtility.FromJson <Association>(base.Put(URLConfig.BASEURL + baseTable, obj))); }
public Association Post(ICreateFormData formData) { return(JsonUtility.FromJson <Association>(base.Post(URLConfig.BASEURL + baseTable, formData))); }
/// <summary> /// Deletes the given yarn from the database. Note this will cascade and delete the references in the YarnLine table associated with this yarn id /// </summary> /// <param name="yarn">The yarn to be deleted</param> public override int Delete(string url, ICreateFormData obj) { return(base.Delete(URLConfig.BASEURL + baseTable, obj)); }
public int Delete(ICreateFormData obj) { return(base.Delete(URLConfig.BASEURL + baseTable, obj)); }
public YarnLineUpdate Put(ICreateFormData obj) { return(JsonUtility.FromJson <YarnLineUpdate>(base.Put(URLConfig.BASEURL + baseTable, obj))); }
public YarnLine Post(ICreateFormData formData) { return(JsonUtility.FromJson <YarnLine>(base.Post(URLConfig.BASEURL + baseTable, formData))); }
/// <summary> /// Posts a Tag to the DB /// </summary> /// <param name="tag">Tag to be posted</param> /// <returns>TODO: Currently posts true always!</returns> public Tag Post(ICreateFormData obj) { return(JsonUtility.FromJson <Tag>(base.Post(URLConfig.BASEURL + baseTable, obj))); }
public Board Put(ICreateFormData obj) { return(JsonUtility.FromJson <Board>(base.Put(URLConfig.BASEURL + baseTable, obj))); }
public Board Post(ICreateFormData formData) { return(JsonUtility.FromJson <Board>(base.Post(URLConfig.BASEURL + baseTable, formData))); }
public Snippet Put(ICreateFormData obj) { return(JsonUtility.FromJson <Snippet>(base.Put(URLConfig.BASEURL + baseTable, obj))); }
public Snippet Post(ICreateFormData formData) { return(JsonUtility.FromJson <Snippet>(base.Post(URLConfig.BASEURL + baseTable, formData))); }
public new string Delete(string url, ICreateFormData obj) { throw new NotImplementedException(); }