예제 #1
0
 /// <summary>
 /// Load a JSON array from the server using a HTTP GET request
 /// </summary>
 /// <param name="options">An options object.</param>
 /// <param name="callback">A callback function that is executed when the request is finished.</param>
 /// <typeparam name="T">The element type of the array.</typeparam>
 public static void GetArray <T>(RequestHelper options, Action <Exception, T[]> callback)
 {
     StaticCoroutine.StartCoroutine(HttpGet.GetArrayUnityWebRequest <T>(options, callback));
 }
예제 #2
0
 /// <summary>
 /// Load data from the server using a HTTP GET request
 /// </summary>
 /// <param name="options">An options object.</param>
 /// <param name="callback">A callback function that is executed when the request is finished.</param>
 /// <typeparam name="T">The relement type of the response.</typeparam>
 public static void Get <T>(RequestHelper options, Action <Exception, ResponseHelper, T> callback)
 {
     StaticCoroutine.StartCoroutine(HttpBase.DefaultUnityWebRequest <T>(options, null, UnityWebRequest.kHttpVerbGET, callback));
 }
예제 #3
0
 /// <summary>
 /// Delete the specified resource identified by the URI.
 /// </summary>
 /// <param name="options">An options object.</param>
 /// <param name="callback">A callback function that is executed when the request is finished.</param>
 public static void Delete(RequestHelper options, Action <Exception, ResponseHelper> callback)
 {
     StaticCoroutine.StartCoroutine(HttpDelete.DeleteUnityWebRequest(options, callback));
 }
예제 #4
0
 /// <summary>
 /// Load data from the server using a HTTP PUT request.
 /// </summary>
 /// <param name="options">An options object.</param>
 /// <param name="bodyJson">A plain object that is sent to the server with the request.</param>
 /// <param name="callback">A callback function that is executed when the request is finished.</param>
 /// <typeparam name="T">The element type of the response.</typeparam>
 public static void Put <T>(RequestHelper options, object bodyJson, Action <Exception, ResponseHelper, T> callback)
 {
     StaticCoroutine.StartCoroutine(HttpBase.DefaultUnityWebRequest <T>(options, bodyJson, UnityWebRequest.kHttpVerbPUT, callback));
 }
예제 #5
0
 /// <summary>
 /// Create an HTTP request with the specified options and callback.
 /// </summary>
 /// <param name="options">The options of the request.</param>
 /// <param name="callback">A callback function that is executed when the request is finished.</param>
 /// <typeparam name="T">The element type of the response.</typeparam>
 public static void Request <T>(RequestHelper options, Action <RequestException, ResponseHelper, T> callback)
 {
     StaticCoroutine.StartCoroutine(HttpBase.DefaultUnityWebRequest <T>(options, callback));
 }
예제 #6
0
 /// <summary>
 /// Load a JSON array from the server using a HTTP GET request
 /// </summary>
 /// <param name="options">The options of the request.</param>
 /// <param name="callback">A callback function that is executed when the request is finished.</param>
 /// <typeparam name="T">The element type of the array.</typeparam>
 public static void GetArray <T>(RequestHelper options, Action <RequestException, ResponseHelper, T[]> callback)
 {
     options.Method = UnityWebRequest.kHttpVerbGET;
     StaticCoroutine.StartCoroutine(HttpBase.DefaultUnityWebRequest <T>(options, callback));
 }