Ejemplo n.º 1
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));
 }
Ejemplo n.º 2
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));
 }
Ejemplo n.º 3
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));
 }
Ejemplo n.º 4
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));
 }
Ejemplo n.º 5
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));
 }
Ejemplo n.º 6
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));
 }