mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-24 16:50:17 +00:00
fix UnityWebRequestException String access is not supported #110
This commit is contained in:
@@ -33,7 +33,10 @@ namespace Cysharp.Threading.Tasks
|
|||||||
this.ResponseCode = unityWebRequest.responseCode;
|
this.ResponseCode = unityWebRequest.responseCode;
|
||||||
if (UnityWebRequest.downloadHandler != null)
|
if (UnityWebRequest.downloadHandler != null)
|
||||||
{
|
{
|
||||||
this.Text = unityWebRequest.downloadHandler.text;
|
if (unityWebRequest.downloadHandler is DownloadHandlerBuffer dhb)
|
||||||
|
{
|
||||||
|
this.Text = dhb.text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -476,8 +476,8 @@ public class SandboxMain : MonoBehaviour
|
|||||||
|
|
||||||
async UniTaskVoid Start()
|
async UniTaskVoid Start()
|
||||||
{
|
{
|
||||||
var url = "http://fooooooooooooooooooooooooooooooooooo.com";
|
var url = "http://google.com/404";
|
||||||
var webRequestAsyncOperation = UnityWebRequest.Head(url).SendWebRequest();
|
var webRequestAsyncOperation = UnityWebRequest.Get(url).SendWebRequest();
|
||||||
await webRequestAsyncOperation.ToUniTask();
|
await webRequestAsyncOperation.ToUniTask();
|
||||||
|
|
||||||
//PlayerLoopInfo.Inject();
|
//PlayerLoopInfo.Inject();
|
||||||
|
|||||||
Reference in New Issue
Block a user