Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Website recieving no data as response

Discussion in 'Multiplayer' started by coreybeavers1999, May 4, 2022.

  1. coreybeavers1999


    May 26, 2021
    I'm trying to get started with networking and so I have hosted a website that just echos a basic hello world and I have copy and pasted the unitywebrequest.get() example but for some reason it's always returning "Received no data in response". Here's the link for my website,

    The code for the php is,


    echo "What up dawg?";


    And the script I'm using in unity is...

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.Networking;

    public class network_getMessage : MonoBehaviour
    // Start is called before the first frame update
    void Start()

    IEnumerator GetMessage()
    UnityWebRequest www = UnityWebRequest.Get("");
    yield return www.SendWebRequest();

    if (www.result != UnityWebRequest.Result.Success)
    Debug.Log("Error: " + www.error);
    // Show results as text