public string url = "http://my.ip.address.221/betsinplay.txt"; //
private bool isDownloaded;
private string downloadedText;
IEnumerator Checkforbetsinplay()
{
using (UnityWebRequest www = UnityWebRequest.Get(url))
{
yield return www.SendWebRequest();
if (www.result == UnityWebRequest.Result.Success)
{
downloadedText = www.downloadHandler.text;
isDownloaded = true;
// Check downloadedText for true or false
if (downloadedText.ToLower() == "true")
{
// Do something if the value is true
Debug.LogError("BETSINPLAY IS TRUE");
}
else if (downloadedText.ToLower() == "false")
{
// Do something if the value is false
Debug.LogError("BETSINPLAY IS FALSE");
}
else
{
// Handle unexpected values
Debug.LogError("Downloaded text format not recognized (expected 'true' or 'false')");
}
}
else
{
Debug.LogError("Download failed: " + www.error);
}
}
}
When I try to run it, i get the following error:
Curl error 1: Protocol "htttps" not supported or disabled in libcurl
now why in the world would it point to a non existant “htttps” protocol? My webserver does redirect http requests to https but in the web browser it does so fine without errors,what gives?
not sure what to type here.
New contributor
John Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.