//Post Json public static UnityWebRequest PostJson(string uri, string jsonString, DownloadHandler downloader) { UnityWebRequest request = UWebRequestCreator.PostRequest(uri, jsonString, downloader); request.uploadHandler.contentType = "application/json; charset=utf-8"; return(request); }
public static UnityWebRequest PostRequest(string uri, WWWForm formData, DownloadHandler downloader) { byte[] data = UWebRequestCreator.FormDataToByte(formData); UnityWebRequest request = UWebRequestCreator.PostRequest(uri, data, downloader); //set request headers if (formData != null) { UWebRequestCreator.SetupRequestHeaders(request, formData.headers); } return(request); }
public static UnityWebRequest PostRequest(string uri, string postData, DownloadHandler downloader) { //string to byte[] byte[] data = null; if (!string.IsNullOrEmpty(postData)) { // data = System.Text.Encoding.UTF8.GetBytes(postData); } UnityWebRequest request = UWebRequestCreator.PostRequest(uri, data, downloader); return(request); }
/*------------------------------------------------------------------*/ #region Get Request //Create Get Request public static UnityWebRequest GetRequest(string uri) { return(UWebRequestCreator.GetRequest(uri, new DownloadHandlerBuffer())); }