Quantcast
Channel: Answers by "RMGK"
Viewing all articles
Browse latest Browse all 45

Answer by RMGK

$
0
0
This is a tough one. The way I got around it was using a custom Uploader using UnityWebRequest. Something like below: UnityWebRequest webRequest = new UnityWebRequest(, "POST"); byte[] encodedPayload = new System.Text.UTF8Encoding().GetBytes(); webRequest.uploadHandler = (UploadHandler) new UploadHandlerRaw(encodedPayload); webRequest.downloadHandler = (DownloadHandler) new DownloadHandlerBuffer(); webRequest.SetRequestHeader("Content-Type", "application/json"); webRequest.SetRequestHeader("cache-control", "no-cache"); UnityWebRequestAsyncOperation requestHandel = webRequest.SendWebRequest(); requestHandel.completed += delegate(AsyncOperation pOperation) { Debug.Log(webRequest.responseCode); Debug.Log(webRequest.downloadHandler.text); };

Viewing all articles
Browse latest Browse all 45

Trending Articles