/// <summary> /// Send JSON message asyncronously over http request. /// </summary> /// <typeparam name="T">JSON message type.</typeparam> /// <param name="request">Request to send.</param> /// <param name="onDone"></param> /// <param name="onError"></param> public void GetAsync <T>(IGXRequest <T> request, DoneEventHandler onDone, ErrorEventHandler onError) { GXAsyncData <T> data = new GXAsyncData <T>(); data.OnError = onError; data.OnDone = onDone; HttpWebRequest req = Send <T>("GET", request, data); }
/// <summary> /// Send JSON message asyncronously over http request. /// </summary> /// <typeparam name="T">JSON message type.</typeparam> /// <param name="request">Request to send.</param> /// <param name="onDone"></param> /// <param name="onError"></param> public void PostAsync <T>(IGXRequest <T> request, DoneEventHandler onDone, ErrorEventHandler onError) { GXAsyncData <T> data = new GXAsyncData <T>(); data.OnError = onError; data.OnDone = onDone; Send <T>("POST", request, data); }
/// <summary> /// Send JSON data. /// </summary> /// <typeparam name="T">JSON message type.</typeparam> /// <param name="request">Request to send.</param> /// <returns>Response from the server.</returns> public virtual T Delete <T>(IGXRequest <T> request) { HttpWebRequest req = Send <T>("DELETE", request, null); return(GetResponse <T>(req)); }
/// <summary> /// Post JSON data. /// </summary> /// <typeparam name="T">JSON message type.</typeparam> /// <param name="request">Request to send.</param> /// <returns>Response from the server.</returns> public virtual T Post <T>(IGXRequest <T> request) { HttpWebRequest req = Send <T>("POST", request, null); return(GetResponse <T>(req)); }
/// <summary> /// Send JSON data. /// </summary> /// <typeparam name="T">JSON message type.</typeparam> /// <param name="route">Additional route.</param> /// <param name="request">Request to send.</param> /// <returns>Response from the server.</returns> public virtual T Put <T>(string route, IGXRequest <T> request) { HttpWebRequest req = Send <T>(null, "PUT", request, null); return(GetResponse <T>(req)); }