fix UnityWebRequestException String access is not supported #110

master
neuecc 2020-07-09 22:17:49 +09:00
parent 42d627f3ba
commit 305c4aaa07
2 changed files with 6 additions and 3 deletions

View File

@ -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;
}
} }
} }

View File

@ -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();