mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-17 20:50:11 +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;
|
||||
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()
|
||||
{
|
||||
var url = "http://fooooooooooooooooooooooooooooooooooo.com";
|
||||
var webRequestAsyncOperation = UnityWebRequest.Head(url).SendWebRequest();
|
||||
var url = "http://google.com/404";
|
||||
var webRequestAsyncOperation = UnityWebRequest.Get(url).SendWebRequest();
|
||||
await webRequestAsyncOperation.ToUniTask();
|
||||
|
||||
//PlayerLoopInfo.Inject();
|
||||
|
||||
Reference in New Issue
Block a user