Hello,
How can I access the url string from this script? I can't seem to access it using Get Property, Set Property or Call Method like I usually can from other scripts.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class MomentaryOpen: MonoBehaviour {
void Start()
{
StartCoroutine(GetText());
}
string authenticate(string username, string password)
{
string auth = username + ":" + password;
auth = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(auth));
auth = "Basic " + auth;
return auth;
}
IEnumerator GetText()
{
string authorization = authenticate("none", "password");
while (true)
{
string url = "http://myURLexample.com";
UnityWebRequest www = UnityWebRequest.Get(url);
www.SetRequestHeader("AUTHORIZATION", authorization);
yield return www.Send();
}
}
}