📅  最后修改于: 2022-03-11 14:48:42.596000             🧑  作者: Mango
IEnumerator SendRequest(string url)
{
UnityWebRequest request = UnityWebRequest.Get(url);
yield return request.SendWebRequest();
if (request.isNetworkError || request.isHttpError)
{
Debug.LogError(string.Format("Error: {0}",request.error));
}
else
{
// Response can be accessed through: request.downloadHandler.text
Debug.Log(request.downloadHandler.text);
}
}